forked from minhngoc25a/freetype2
Compare commits
39 Commits
master
...
priyesh_Lo
Author | SHA1 | Date |
---|---|---|
Priyeshkkumar | 9dd5fc35dc | |
Priyeshkkumar | 814f38f337 | |
Priyeshkkumar | faa3ee95a5 | |
Priyeshkkumar | c96739bfc9 | |
Priyesh Kumar | 92847d87ef | |
Priyeshkkumar | ec03321013 | |
Priyeshkkumar | 4f472b5799 | |
Priyeshkkumar | 17700d419b | |
Priyesh Kumar | dc3c410a83 | |
Priyesh Kumar | d86528a78e | |
Priyesh Kumar | ea09f0b7dc | |
Priyesh Kumar | 8bb02e725f | |
Priyeshkkumar | 008ee3ebca | |
Priyesh Kumar | 84c719491f | |
Priyesh Kumar | 141ac5301b | |
Priyesh Kumar | daefd6e6cf | |
Priyesh Kumar | c945a046b1 | |
Priyeshkkumar | b528826f69 | |
Priyeshkkumar | b5d7cd3a4b | |
Priyesh Kumar | 4e3b8181a3 | |
Priyeshkkumar | a0f918d1f1 | |
Priyesh Kumar | 117da1f7e6 | |
Priyeshkkumar | 9bd35c7d91 | |
Priyeshkkumar | df53385b67 | |
Priyeshkkumar | 1e1912dbac | |
Priyesh Kumar | b3deaa037e | |
Priyesh Kumar | e854adc669 | |
Priyeshkkumar | 708d8098ec | |
Priyeshkkumar | 7d785da7a2 | |
Priyeshkkumar | afa548bb74 | |
Priyeshkkumar | 0c793e381c | |
Priyeshkkumar | bfe6d5218a | |
Priyeshkkumar | b378812f22 | |
Priyeshkkumar | fde1c1698d | |
Priyeshkkumar | 1d6ffcc77a | |
Priyeshkkumar | f7c5ed5f24 | |
Priyeshkkumar | 52926578db | |
Priyeshkkumar | 421bb589e6 | |
Priyeshkkumar | 01ce8ff340 |
|
@ -0,0 +1,16 @@
|
|||
BasedOnStyle: Chromium
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: true
|
||||
AlignConsecutiveDeclarations: true
|
||||
AlignConsecutiveMacros: true
|
||||
AlignEscapedNewlines: true
|
||||
# AlignOperands: Align
|
||||
AlignTrailingComments: true
|
||||
AlwaysBreakAfterReturnType: AllDefinitions
|
||||
BreakBeforeBraces: Allman
|
||||
ColumnLimit: 80
|
||||
DerivePointerAlignment: false
|
||||
IndentCaseLabels: false
|
||||
PointerAlignment: Left
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpacesInParentheses: true
|
|
@ -0,0 +1,3 @@
|
|||
[submodule "submodules/dlg"]
|
||||
path = submodules/dlg
|
||||
url = https://github.com/nyorain/dlg.git
|
|
@ -241,7 +241,7 @@ if (UNIX)
|
|||
check_include_file("unistd.h" HAVE_UNISTD_H)
|
||||
check_include_file("fcntl.h" HAVE_FCNTL_H)
|
||||
|
||||
file(READ "${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.in"
|
||||
file(READ "${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.h.in"
|
||||
FTCONFIG_H)
|
||||
if (HAVE_UNISTD_H)
|
||||
string(REGEX REPLACE
|
||||
|
@ -253,8 +253,6 @@ if (UNIX)
|
|||
"#undef +(HAVE_FCNTL_H)" "#define \\1 1"
|
||||
FTCONFIG_H "${FTCONFIG_H}")
|
||||
endif ()
|
||||
string(REPLACE "/undef " "#undef "
|
||||
FTCONFIG_H "${FTCONFIG_H}")
|
||||
else ()
|
||||
file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftconfig.h"
|
||||
FTCONFIG_H)
|
||||
|
|
263
ChangeLog
263
ChangeLog
|
@ -1,3 +1,266 @@
|
|||
2020-07-28 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
Fix `-Wformat' compiler warnings.
|
||||
|
||||
* src/*: Fix format specifiers.
|
||||
|
||||
* builds/unix/ftsystem.c (FT_Stream_Open): Ditto.
|
||||
|
||||
2020-07-25 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
Fix `-Wformat' compiler warnings.
|
||||
|
||||
Problem reported by Priyesh kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
* src/base/ftoutln.c (FT_Outline_Decompose): Fix number of arguments
|
||||
to tracing macro.
|
||||
|
||||
* src/bdf/bdfdrivr.c (bdf_cmap_char_next, bdf_get_bdf_property):
|
||||
Ditto.
|
||||
|
||||
* src/cache/ftcbasic.c (ftc_basic_family_get_count): Ditto.
|
||||
Reformulate message.
|
||||
|
||||
* src/pcf/pcfdrivr.c (pcf_get_bdf_property): Ditto.
|
||||
|
||||
* src/sfnt/sfwoff2.c (woff2_open_font): Ditto.
|
||||
Trace table offset, too.
|
||||
|
||||
* src/truetype/ttgxvar.c (ft_var_apply_tuple): Ditto.
|
||||
|
||||
2020-07-23 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
* src/sfnt/sfwoff2.c (woff2_decompress): Fix compiler warning.
|
||||
|
||||
Reported by Hin-Tak.
|
||||
|
||||
2020-07-12 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
* builds/unix/configure.raw: Fix inclusion of `ftoption.h'.
|
||||
|
||||
2020-07-07 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
Fix clang warnings.
|
||||
|
||||
* include/freetype/internal/autohint.h
|
||||
(FT_DECLARE_AUTOHINTER_INTERFACE): New macro.
|
||||
* src/autofit/afmodule.h: Use it to declare
|
||||
`af_autofitter_interface'.
|
||||
|
||||
* include/freetype/internal/ftobjs.h (FT_DECLARE_GLYPH): New macro.
|
||||
* src/base/ftbase.h: Use it to declare `ft_bitmap_glyph_class' and
|
||||
`ft_outline_glyph_class'.
|
||||
|
||||
* src/base/ftglyph.c: Include `ftbase.h'.
|
||||
|
||||
* src/cff/cffparse.c (cff_parser_run): Fix type of `t2_size'.
|
||||
|
||||
* src/pcf/pcfdrivr.c (pcf_cmap_char_next): Fix type of `result'.
|
||||
|
||||
* src/psaux/psauxmod.c (psaux_module_class): Use `FT_DEFINE_MODULE'.
|
||||
* src/psaux/psauxmod.h: Declare `afm_parser_funcs',
|
||||
`t1_cmap_classes', `cff_decoder_funcs', and `psaux_module_class'.
|
||||
|
||||
* src/pshinter/pshmod.c: Include `pshmod.h'.
|
||||
|
||||
* src/sfnt/sfwoff2.c (ROUND4, WRITE_SHORT): Fix implicit sign
|
||||
conversion.
|
||||
(compute_ULong_sum): Fix return type.
|
||||
Fix implicit sign conversion.
|
||||
(store_points): Fix type of `last_flag', `repeat_count', and `flag'.
|
||||
Use casts to avoid warnings.
|
||||
(reconstruct_glyf): Fix implicit sign conversion.
|
||||
Use cast to avoid warning.
|
||||
(get_x_mins): Fix implicit sign conversion.
|
||||
* src/sfnt/ttcmap.c: Undef `TTCMAPCITEM'.
|
||||
* src/sfnt/ttcmap.h: Define `TTCMAPCITEM' and include `ttcmapc.h' to
|
||||
declare cmap classes.
|
||||
|
||||
* src/smooth/ftsmooth.c (ft_smooth_overlap_spans): Use cast.
|
||||
|
||||
* src/truetype/ttinterp.c (Ins_MIAP): Fix typo.
|
||||
|
||||
2020-07-07 David Turner <david@freetype.org>
|
||||
|
||||
[build] Really fix multi and C++ builds.
|
||||
|
||||
The following builds were still failing due to previous changes:
|
||||
|
||||
make multi
|
||||
make multi CC="c++"
|
||||
make CC="c++"
|
||||
|
||||
This patch fixes the issues, which were missing includes to get the
|
||||
right macro definitions in multi-build mode.
|
||||
|
||||
Also, `FT_UNUSED' is actually used by third-party code, so move it
|
||||
back to `public-macros.h' to avoid breaking it.
|
||||
|
||||
* include/freetype/config/public-macros.h (FT_EXPORT): Remove
|
||||
special definition for C++.
|
||||
(FT_UNUSED): Define here instead of...
|
||||
* include/freetype/config/compiler-macros.h: ... here.
|
||||
(FT_FUNCTION_DECLARATION): Remove special definition for C++.
|
||||
(FT_LOCAL_ARRAY_DEF): Fix definition.
|
||||
|
||||
* src/cache/ftccback.h, src/lzw/ftzopen.h, src/gxvalid/gxvmort.h,
|
||||
src/gxvalid/gxvmorx.h: Add `FT_BEGIN_HEADER' and `FT_END_HEADER'.
|
||||
|
||||
2020-07-06 David Turner <david@freetype.org>
|
||||
|
||||
[build] Fix multi and C++ builds.
|
||||
|
||||
The following builds were failing due to previous changes:
|
||||
|
||||
make multi
|
||||
make multi CC="c++"
|
||||
|
||||
* include/freetype/config/ftconfig.h: Remove `FT_END_HEADER'.
|
||||
|
||||
* include/freetype/config/ftheader.h (FT_BEGIN_HEADER,
|
||||
FT_END_HEADER): Protect against redefinition.
|
||||
|
||||
* src/cache/ftccache.h, src/cache/ftcmru.h, src/pcf/pcfutil.h,
|
||||
src/psaux/pserror.h, src/psaux/psft.h, src/psaux/psstack.h,
|
||||
src/sfnt/woff2tags.h: Include `compiler-macros.h'.
|
||||
|
||||
* src/sfnt/woff2tags.c: Include `woff2tags.h'.
|
||||
|
||||
2020-07-06 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
[psaux] Improve `t1_decoder_parse_metrics' (#58646).
|
||||
|
||||
* src/psaux/t1decode.c (t1_decoder_parse_metrics): Copy
|
||||
corresponding code from old engine's `t1_decoder_parse_charstrings'
|
||||
function to handle `op_callsubr' and `op_return'.
|
||||
|
||||
2020-07-05 David Turner <david@freetype.org>
|
||||
|
||||
[build] Improve visibility support of library function names.
|
||||
|
||||
* include/freetype/config/public-macros.h
|
||||
(FT_PUBLIC_FUNCTION_ATTRIBUTE): New macro to tag functions as
|
||||
public (and thus exportable).
|
||||
(FT_EXPORT): Use it.
|
||||
|
||||
* include/freetype/config/compiler-macros.h
|
||||
(FT_INTERNAL_FUNCTION_ATTRIBUTE): New macro to tag functions as
|
||||
internal to the library (and thus hidden). Note that on ELF
|
||||
systems, all internal functions have hidden visibility, which avoids
|
||||
the need to enforce this when invoking the compiler (e.g., with an
|
||||
option like `-fvisibility=hidden').
|
||||
|
||||
(FT_FUNCTION_DECLARATION, FT_FUNCTION_DEFINITION): New base macros
|
||||
to deal with C and C++ linkage issues at the same time.
|
||||
|
||||
(FT_LOCAL, FT_LOCAL_DEF, FT_LOCAL_ARRAY, FT_LOCAL_ARRAY_DEF,
|
||||
FT_BASE, FT_BASE_DEF, FT_EXPORT_VAR, FT_BASE_CALLBACK,
|
||||
FT_BASE_CALLBACK_DEF): Redefined using new macros.
|
||||
|
||||
2020-07-05 David Turner <david@freetype.org>
|
||||
|
||||
[build] Split off more stuff from `ftconfig.h'.
|
||||
|
||||
* builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
|
||||
include/freetype/config/ftconfig.h: Split off macro definitions
|
||||
required by the FreeType API headers to...
|
||||
* include/freetype/config/public-macros.h: ...this new file.
|
||||
|
||||
* builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
|
||||
include/freetype/config/ftconfig.h: Split off macro definitions used
|
||||
by the library but not to be exposed to clients to...
|
||||
* include/freetype/config/compiler-macros.h: ...this new file.
|
||||
|
||||
* include/freetype/internal/*.h, src/raster/ftraster.h: Include
|
||||
`compiler-macros.h' where needed.
|
||||
|
||||
2020-07-05 David Turner <david@freetype.org>
|
||||
|
||||
[build] Move mac support code to `mac-support.h'.
|
||||
|
||||
* builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
|
||||
include/freetype/config/ftconfig.h: Split off mac-specific stuff
|
||||
to...
|
||||
* include/freetype/config/mac-support.h: ...this new file.
|
||||
|
||||
* CMakeLists.txt, builds/unix/configure.raw: Remove `/undef ->
|
||||
#undef' string replacement; the affected code is no longer part of
|
||||
the `ftconfig.h' template.
|
||||
|
||||
2020-07-05 David Turner <david@freetype.org>
|
||||
|
||||
[build] Put integer type definitions into `integer-types.h'.
|
||||
|
||||
Refactor some of the `ftconfig.h' headers and template to move the
|
||||
definition of the FreeType integer types (e.g., `FT_Int16') to a
|
||||
common header file `freetype/config/integer-types.h'.
|
||||
|
||||
* builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
|
||||
include/freetype/config/ftconfig.h: Split off integer type
|
||||
definition stuff to...
|
||||
* include/freetype/config/integer-types.h: ...this new file.
|
||||
|
||||
* builds/unix/ftconfig.h.in: Control the definition of
|
||||
`FT_SIZEOF_INT' and `FT_SIZEOF_LONG' with macro
|
||||
`FT_USE_AUTOCONF_SIZEOF_TYPES'. If these are not defined, auto
|
||||
detection happens in `integer-types.h' as usual based on `INTXX_MAX'
|
||||
values. Otherwise the autoconf-detected values are used.
|
||||
|
||||
* builds/unix/configure.raw (CPPFLAGS): Don't include path to
|
||||
`config' directory. Instead, ...
|
||||
(FT_CONFIG_STANDARD_LIBRARY_H): Use complete path.
|
||||
|
||||
2020-07-05 David Turner <david@freetype.org>
|
||||
|
||||
[build] Rename `build/unix/ftconfig.in' to `ftconfig.h.in'.
|
||||
|
||||
Since we are no longer limited to 8.3 file names, it is simpler to
|
||||
follow the usual conventions for template files.
|
||||
|
||||
* builds/unix/ftconfig.in: Renamed to...
|
||||
* builds/unix/ftconfig.h.in: ...this.
|
||||
|
||||
* CMakeLists.txt, builds/unix/configure.raw: Updated.
|
||||
|
||||
2020-07-03 Alexei Podtelezhnikov <apodtele@gmail.com>
|
||||
|
||||
[smooth] Introduce direct oversampling for overlaps.
|
||||
|
||||
This implements oversampling to metigate artifacts in pixels partially
|
||||
covered by overlapping contours. It turns out that the 4x4
|
||||
oversampling is sufficient but, at least, quadruples the rendering
|
||||
time. The outline has to set FT_OUTLINE_OVERLAP to use this method.
|
||||
|
||||
* include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): New flag.
|
||||
* src/smooth/ftsmooth.c (ft_smooth_render): Check it to...
|
||||
(ft_smooth_raster_overlap): ... inflate outline and set up direct
|
||||
rendering for oversampling with...
|
||||
(ft_smooth_overlap_spans): ... new span function that integrates them.
|
||||
|
||||
2020-07-03 Alexei Podtelezhnikov <apodtele@gmail.com>
|
||||
|
||||
[smooth] Use direct rendering mode in Harmony.
|
||||
|
||||
Instead of rendering 3 bitmaps side by side and reshuffling, we use
|
||||
direct rendering to deliver the bitmaps on each third byte.
|
||||
|
||||
* src/smooth/ftsmooth.c (ft_smooth_raster_lcd)
|
||||
[!FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Set up direct mode with...
|
||||
(ft_smooth_lcd_spans): ... new span function.
|
||||
|
||||
2020-07-03 Alexei Podtelezhnikov <apodtele@gmail.com>
|
||||
|
||||
[smooth] Separate LCD paths from gray rendering.
|
||||
|
||||
This makes `ft_smooth_render' a lot smaller and easier to follow. It
|
||||
also cleanly separates Harmony and ClearType-style LCD rendering
|
||||
algorithms. Now I only wish to move LCD filtering and geometry from
|
||||
FT_Library to FT_Renderer.
|
||||
|
||||
* src/smooth/ftsmooth.c (ft_smooth_render): Move LCD code from here...
|
||||
(ft_smooth_raster_lcd, ft_smooth_raster_lcdv): ... to here.
|
||||
[FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Reorganize #ifdef's.
|
||||
|
||||
2020-06-20 Sebastian Rasmussen <sebras@gmail.com>
|
||||
|
||||
[cff] Fix handling of `style_name == NULL' (#58630).
|
||||
|
|
12
README
12
README
|
@ -67,6 +67,18 @@
|
|||
a terse message that only says `it doesn't work'.
|
||||
|
||||
|
||||
Patches
|
||||
=======
|
||||
|
||||
Please submit patches to the `freetype-devel@nongnu.org' mailing
|
||||
list -- and thank you in advance for your work on improving
|
||||
FreeType!
|
||||
|
||||
Details on the process can be found here:
|
||||
|
||||
https://www.freetype.org/developer.html#patches
|
||||
|
||||
|
||||
Enjoy!
|
||||
|
||||
|
||||
|
|
|
@ -35,6 +35,13 @@ Similarly, a build with `cmake' can be done directly from the git
|
|||
repository.
|
||||
|
||||
|
||||
For using the `FT_LOGGING' macro while debugging(see docs/DEBUG for
|
||||
more information) use the following git commands to checkout `dlg'
|
||||
library as a git submodule.
|
||||
|
||||
git submodule init
|
||||
git submodule update
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (C) 2005-2020 by
|
||||
|
|
|
@ -0,0 +1,327 @@
|
|||
2020-08-24 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
* docs/DEBUG: Update documentation.
|
||||
|
||||
* builds/windows/ftdebug.c (ft_logging_init, ft_logging_init):
|
||||
Fixed coding style.
|
||||
|
||||
* src/base/ftdebug.c (ft_logging_init): Fixed coding style.
|
||||
|
||||
* builds/windows/ftdebug.c (ft_log_handler): Updated code according to the
|
||||
recent updates in dlg library.
|
||||
(ft_logging_init): Added environment variable `FT_LOGGING_FILE', the
|
||||
variable `ft_fileptr' stores it's value.
|
||||
Changed function name `ft_custom_log_handler'->
|
||||
`FT_Custom_Log_Handler'.
|
||||
(ft_debug_init): Code Cleanup.
|
||||
|
||||
* src/sfnt/ttload.c (tt_face_load_font_dir): Changed layout of tracing
|
||||
messages.
|
||||
|
||||
* src/base/ftdebug.c (ft_logging_init): Fix Seg fault.
|
||||
|
||||
* include/freetype/ftlogging.h (FT_Trace_Set_Level): Use more relevant
|
||||
parameters name in function declaration.
|
||||
(FT_Custom_Log_Handler): Changed function name `ft_custom_log_handler'->
|
||||
`FT_Custom_Log_Handler'.
|
||||
Updated documentation.
|
||||
|
||||
* include/freetype/ftchapters.h: Added `debugging_apis' section under
|
||||
`support_api' chapter.
|
||||
|
||||
* .gitmodules: Updated submodule to track recent changes in dlg library.
|
||||
|
||||
* src/base/ftdebug.c (ft_log_handler): Updated code according to the
|
||||
recent updates in dlg library.
|
||||
(ft_logging_init): Added environment variable `FT_LOGGING_FILE', the
|
||||
variable `ft_fileptr' stores it's value.
|
||||
Changed function name `ft_custom_log_handler'->
|
||||
`FT_Custom_Log_Handler'.
|
||||
|
||||
* include/freetype/internal/ftdebug.h: Changed function name
|
||||
`ft_custom_log_handler'-> `FT_Custom_Log_Handler'.
|
||||
|
||||
* README.git: Updated documentation.
|
||||
|
||||
* docs/DEBUG: Updated documentation.
|
||||
|
||||
2020-08-21 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
* include/freetype/internal/ftdebug.h (FT_LOG ): Use more relevant
|
||||
temporary variable name, to hold the name of FT_COMPONENT.
|
||||
(FT_ERROR): Store the name of `FT_COMPONENT' in a temporary variable
|
||||
and then pass it as a parameter to `ft_add_tag' and `ft_remove_tag'.
|
||||
|
||||
* src/base/ftdebug.c : Updated Comments.
|
||||
(FT_Trace_Set_Level, FT_Trace_Set_Default_Level): Reinitialize the
|
||||
values of `ft_timestamp_flag' and `ft_component_flag' every time
|
||||
`FT_Trace_Set_Level' and `FT_Trace_Set_Default_Level' is used.
|
||||
|
||||
* builds/windows/vc2010/freetype.vcxproj (PreprocessorDefinitions):
|
||||
Added `DLG_STATIC' for `Debug Static' configuration on both platforms.
|
||||
|
||||
2020-08-13 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
* src/base/ftobjs.c (Mac_Read_POST_Resource): Fixed `-Wformat'
|
||||
warnings.
|
||||
|
||||
* src/bdf/bdflib.c (ACMSG3, ACMSG7): Fixed `-Wformat' warnings.
|
||||
|
||||
[priyesh]ChangeLog: Fix Date.
|
||||
|
||||
* builds/windows/dlg/dlg.vcxproj (PreprocessorDefinitions): Added
|
||||
`DLG_STATIC' macro for Static builds of dlg on both `x64' and `Win32'
|
||||
platforms.
|
||||
|
||||
* builds/windows/vc2010/freetype.vcxproj (PreprocessorDefinitions):
|
||||
Added `FT_LOGGING' macro for Debug builds of FreeType on both `x64' and
|
||||
`Win32' platforms.
|
||||
|
||||
2020-08-12 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
* src/base/ftdebug.c (ft_log_handler): Fix "-Wunused-parameter" warning.
|
||||
|
||||
* include/freetype/ftlogging.h ( FTLOGGING_H_ ): Added Include guard.
|
||||
|
||||
* src/*: Fixed format specifiers.
|
||||
|
||||
* [priyesh]ChangeLog: Fix typo.
|
||||
|
||||
Bug fix on Windows.
|
||||
|
||||
* include/freetype/internal/ftdebug.h (FT_LOG): Store the name of current
|
||||
`FT_COMPONENT' and then pass it to the functions `ft_add_tag()' and
|
||||
`ft_remove_tag()'
|
||||
|
||||
2020-08-06 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
[build] Fix MinGW errors while building dlg with FreeType on Windows.
|
||||
|
||||
* builds/freetype.mk (DLG_DIR): New variable to include dlg's header
|
||||
files.
|
||||
(INCLUDES): Added `DLG_DIR'
|
||||
When using MinGW to build dlg along with FreeType on Windows there are
|
||||
missing dlg's include files errors. Therefore we need to add path to dlg's
|
||||
include files to remove the errors.
|
||||
|
||||
* src/base/ftsystem.c: Fix `-Wformat' warnings.
|
||||
|
||||
2020-07-30 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
* builds/windows/vc2010/freetype.sln: Skip building dlg for `Release' and
|
||||
`Release Static' Configurations on both platforms.
|
||||
|
||||
* include/freetype/config/ftoption.h (DLG_STATIC): Removed Macro.
|
||||
Removed comments related to `DLG_STATIC' macro.
|
||||
|
||||
* [priyesh]ChangeLog: Fix typo.
|
||||
|
||||
Added a Visual Studios project to build dlg along with FreeType on Windows.
|
||||
|
||||
* builds/windows/dlg/dlg.{vcxproj, vcxproj.filters}: New files.
|
||||
|
||||
* builds/windows/dlg/script.bat: New Batch File. It is called as a pre-
|
||||
built event while building dlg to copy files from `submodules/dlg' to
|
||||
`src/dlg'.
|
||||
|
||||
* builds/windows/vc2010/freetype.sln: Added a subproject to build `dlg'
|
||||
for `Debug' and `Debug Static' Configurations in `Win32' and `x64'
|
||||
platforms.
|
||||
|
||||
* builds/windows/vc2010/freetype.vcxproj (AdditionalIncludeDirectories):
|
||||
Added dlg's include files for all configurations and platforms.
|
||||
(AdditionalDependencies): Added `dlg.lib' as a dependency for `Debug`
|
||||
configuration of FreeType on both platforms.
|
||||
(PreprocessorDefinitions): Added `DLG_STATIC' for `Debug Static'
|
||||
configuration on both platforms.
|
||||
|
||||
* [priyesh]ChangeLog: Fix date.
|
||||
|
||||
2020-07-28 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
Merging master branch with current branch(priyeshLogLibrary)
|
||||
|
||||
2020-07-22 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
* builds/freetype.mk (FT_CFLAGS): Added `-std=c99' flag
|
||||
|
||||
* builds/unix/unix-cc.in (CFLAGS): Added `-std=c99' flag
|
||||
|
||||
* include/freetype/internal/ftdebug.h: Updated include path of dlg to
|
||||
`#include<..src/dlg/dlg/dlg.h>' and `#include<..src/dlg/dlg/output.h>`
|
||||
|
||||
* src/dlg/rules.mk (DLG_H): Updated.
|
||||
|
||||
* builds/toplevel.mk, autogen.sh: Copy dlg's include files from
|
||||
`submodules/dlg' to `src/dlg/dlg' due to include path errors
|
||||
on windows.
|
||||
|
||||
* builds/toplevel.mk: For builds that do not use `./configure' script dlg
|
||||
files are copied from `submodules/dlg' to `src/dlg'.
|
||||
|
||||
* builds/compiler/gcc.mk (CFLAGS), builds/unix/unix-cc.in (CFLAGS):
|
||||
Removed `-std=c99' flag.
|
||||
|
||||
* src/base/ftdebug.c (ft_add_tag, ft_remove_tag): Minor changes
|
||||
|
||||
* src/dlg/rules.mk (FT_CFLAGS): Added `-std=c99' flag
|
||||
|
||||
2020-07-21 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
* builds/freetype.mk: Updates to build dlg along with rest of base and
|
||||
module objects.
|
||||
|
||||
* autogen.sh: Minor changes.
|
||||
|
||||
2020-07-20 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
* Changed git submodule(dlg) from `src/dlg` to `submodules/dlg`
|
||||
|
||||
* Updated autogen.sh file:
|
||||
For copying the necessary files from `submodules/dlg` to `src\dlg`.
|
||||
If the git submodule(dlg) is not checked-out, first it runs necessary
|
||||
git commands for checking out the submodule(dlg) ad then it copies
|
||||
the files.
|
||||
* include/freetype/internal/ftdebug.h:
|
||||
Updated the include path for dlg.
|
||||
|
||||
* Added a new file `src/dlg/rules.mk`
|
||||
|
||||
2020-07-15 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
* builds/compiler/gcc.mk: Added a flag -std=c99 for using dlg on windows
|
||||
|
||||
* builds/windows/ftdebug.c: Added support for using `FT_LOGGING` on
|
||||
windows.
|
||||
|
||||
2020-07-13 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
* include/freetype/ftlogging.h: Changed the definition of callback
|
||||
function `ft_custom_log_handler` now it also provides FT_COMPONENT
|
||||
value to the external log handeling function.
|
||||
|
||||
* include/freetype/internal/ftdebug.h:
|
||||
1. Added a function `FT_Callback()` which is used when user sets an
|
||||
external log handeling callback function.
|
||||
2. Code Cleanup and resolved [ -Wunused-variable ] warnings
|
||||
3. Added a macro `FT_LOG` to handle the `FT_TRACE`
|
||||
* src/base/ftdebug.c:
|
||||
1. Updated code to print FT_COMPONENT and TimeStamp.
|
||||
2. Code Cleanup.
|
||||
3.Added support of flag within `FT2_DEBUG` env variable to control
|
||||
the printing of extra info( time-stamp and FT_COMPONENT ):
|
||||
3.1 '-v' for printing FT_COMPONENT along with actual log message
|
||||
3.2 '-t' for printing TimeStamp along with actual log message
|
||||
3.3 '-tv' or '-vt' for printing both FT_COMPONENT and TimeStamp
|
||||
along with actual log message.
|
||||
4. Added definition of function `FT_Callback()`
|
||||
|
||||
2020-07-04 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
* Added code to print FT_COMPONENT along with TimeStamp with each log
|
||||
|
||||
2020-07-04 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
* include/freetype/ftlogging.h: Added two functions `FT_Set_Log_Handler()`
|
||||
and `FT_Set_Default_Log_Handler()` to enable the callback functionality.
|
||||
|
||||
* include/freetype/internal/ftdebug.h: Some Code Cleanup
|
||||
|
||||
* src/base/ftdebug.c:
|
||||
1. Added definitions for functions:
|
||||
`FT_Set_Default_Log_Handler()` and `FT_Set_Log_Handler()`.
|
||||
2. Added support for callback function.
|
||||
|
||||
|
||||
2020-07-03 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
* Code Cleanup and Added more comments
|
||||
|
||||
* include/freetype/internal/ftdebug.h:
|
||||
1. Code Cleanup
|
||||
2. Reverted back to the original `ft_debug_init()` function
|
||||
Added respective code inside `ft_debug_init()` to handle
|
||||
default and custom trace levels in `ftdebug.c`
|
||||
3. Introduced variables to control logging.
|
||||
|
||||
* src/base/ftdebug.c:
|
||||
1. Updated definitions of following functions:
|
||||
1.1. ft_debug_init()
|
||||
1.2. FT_Trace_Set_Default_Level()
|
||||
1.3. FT_Trace_Set_Level
|
||||
2. Added more comments and Code Cleanup
|
||||
|
||||
2020-07-02 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
* Fixed some code layout
|
||||
|
||||
* Added a new header- `include/freetype/ftlogging.h` for public APIs to
|
||||
use when using logging:
|
||||
1. FT_Trace_Set_Level(): Used to change trace level of components at
|
||||
runtime.
|
||||
2. FT_Trace_Set_Default_Level(): Used to set the default value of trace
|
||||
level(which is supplied by env FT2_DEBUG)
|
||||
|
||||
* include/freetype/internal/ftdebug.h:
|
||||
1. Added dlg support for FT_ERROR, now error messages are also written
|
||||
on file if FT_LOGGING is enabled.
|
||||
2. Changed `ft_debug_init()`: now it takes an argument of type const
|
||||
char* which is used to specify trace level.
|
||||
|
||||
* src/base/ftobjs.c: Changed `ft_debug_init()`, now it passes an argument
|
||||
to define trace level.
|
||||
|
||||
* src/base/ftdebug.c: Added definitions of public APIs
|
||||
`FT_Trace_Set_Default_Level()` and `FT_Trace_Set_Level()`
|
||||
|
||||
* Strated working on Callback.
|
||||
|
||||
* Minor Updates on support of FT_ERROR part
|
||||
|
||||
2020-06-30 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
* Adding new line at end of file
|
||||
|
||||
* include/freetype/internal/ftdebug.h: Added a FreeType specific dlg
|
||||
output handler to print trace logs to file ~
|
||||
`ft_freetype_output_handler()`
|
||||
|
||||
* src/base/ftdebug.c:
|
||||
1. If FT_LOGGING is enabled `ft_debug_init()` will be called from
|
||||
`ft_logging_init()`
|
||||
2. Added function definition of `ft_freetype_output_handler)()`
|
||||
|
||||
* src/base/ftobjs.c: If FT_LOGGING macro is disabled, only then FreeType
|
||||
will call `ft_debug_init()` else it is controlled by logging APIs.
|
||||
|
||||
* Fixed Scaling
|
||||
|
||||
2020-06-29 Priyesh Kumar <priyeshkkumar@gmail.com>
|
||||
|
||||
* Added submodule - dlg library (https://github.com/nyorain/dlg)
|
||||
in src/dlg.
|
||||
This library is used as a logger for FreeType.
|
||||
|
||||
* include/freetype/config/ftoption.h: Added macro `FT_LOGGING`
|
||||
to enable/disable logging in FreeType using dlg.
|
||||
|
||||
* [builds] unix-cc-in: Added -std=c99, since dlg does not support
|
||||
C standards below c99.
|
||||
|
||||
* include/freetype/internal/ftdebug.h: Created an environment for dlg
|
||||
support in FreeType.
|
||||
|
||||
* include/freetype/internal/ftdebug.h: Added functions
|
||||
`ft_logging_init()` and `ft_logging_deinit()` for initializing and
|
||||
un-initalizing FILE*.
|
||||
|
||||
* src/base/ftdebug.c:
|
||||
1. Added a FILE* to write logs to file
|
||||
2. Added function definitions for functions
|
||||
`ft_logging_init()` and `ft_logging_deinit()`.
|
||||
|
||||
* src/base/ftinit.c:
|
||||
1. Added a function call to `ft_logging_init()` in `FT_Init_FreeType()`
|
||||
if FT_LOGGING macro is enabled.
|
||||
2. Added function call to `ft_logging_deinit()` in `FT_Done_FreeType()`
|
||||
if FT_LOGGING macro is enabled.
|
22
autogen.sh
22
autogen.sh
|
@ -162,4 +162,26 @@ cd ../..
|
|||
|
||||
chmod +x ./configure
|
||||
|
||||
copy_submodule_files()
|
||||
{
|
||||
echo "Copying files from \`submodules/dlg' to \`src/dlg'"
|
||||
mkdir src/dlg/dlg
|
||||
cp $DLG_INC_DIR/dlg.h src/dlg/dlg
|
||||
cp $DLG_INC_DIR/output.h src/dlg/dlg
|
||||
cp $DLG_SRC_DIR/* src/dlg
|
||||
}
|
||||
|
||||
DLG_INC_DIR=submodules/dlg/include/dlg
|
||||
DLG_SRC_DIR=submodules/dlg/src/dlg
|
||||
|
||||
if ! test -d "$DLG_INC_DIR"; then
|
||||
echo "Submodule check out in \`submodules/dlg':"
|
||||
git submodule init
|
||||
git submodule update
|
||||
|
||||
copy_submodule_files
|
||||
else
|
||||
copy_submodule_files
|
||||
fi
|
||||
|
||||
# EOF
|
||||
|
|
|
@ -61,7 +61,7 @@ T := -o$(space)
|
|||
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
|
||||
# ANSI compliance.
|
||||
#
|
||||
CFLAGS ?= -c -g -O3 -Wall
|
||||
CFLAGS ?= -c -g -O3 -Wall
|
||||
|
||||
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
||||
#
|
||||
|
|
|
@ -101,6 +101,7 @@ PUBLIC_DIR := $(TOP_DIR)/include/freetype
|
|||
INTERNAL_DIR := $(PUBLIC_DIR)/internal
|
||||
SERVICES_DIR := $(INTERNAL_DIR)/services
|
||||
CONFIG_DIR := $(PUBLIC_DIR)/config
|
||||
DLG_DIR := $(TOP_DIR)/src/dlg
|
||||
|
||||
# The documentation directory.
|
||||
#
|
||||
|
@ -122,7 +123,8 @@ PROJECT_LIBRARY := $(LIB_DIR)/$(LIBRARY).$A
|
|||
INCLUDES := $(subst /,$(COMPILER_SEP),$(OBJ_DIR) \
|
||||
$(DEVEL_DIR) \
|
||||
$(BUILD_DIR) \
|
||||
$(TOP_DIR)/include)
|
||||
$(DLG_DIR) \
|
||||
$(TOP_DIR)/include)
|
||||
|
||||
INCLUDE_FLAGS := $(INCLUDES:%=$I%)
|
||||
|
||||
|
@ -152,7 +154,7 @@ endif
|
|||
#
|
||||
FT_CFLAGS = $(CPPFLAGS) \
|
||||
$(CFLAGS) \
|
||||
$DFT2_BUILD_LIBRARY
|
||||
$DFT2_BUILD_LIBRARY -std=c99
|
||||
|
||||
FT_COMPILE := $(CC) $(ANSIFLAGS) $(INCLUDE_FLAGS) $(FT_CFLAGS)
|
||||
|
||||
|
@ -220,6 +222,7 @@ $(FTDEBUG_OBJ): $(FTDEBUG_SRC) $(FREETYPE_H)
|
|||
#
|
||||
include $(SRC_DIR)/base/rules.mk
|
||||
include $(patsubst %,$(SRC_DIR)/%/rules.mk,$(MODULES))
|
||||
include $(SRC_DIR)/dlg/rules.mk
|
||||
|
||||
|
||||
# ftinit component
|
||||
|
@ -260,8 +263,8 @@ endif
|
|||
|
||||
# All FreeType library objects.
|
||||
#
|
||||
OBJ_M := $(BASE_OBJ_M) $(BASE_EXT_OBJ) $(DRV_OBJS_M)
|
||||
OBJ_S := $(BASE_OBJ_S) $(BASE_EXT_OBJ) $(DRV_OBJS_S)
|
||||
OBJ_M := $(BASE_OBJ_M) $(BASE_EXT_OBJ) $(DRV_OBJS_M) $(DLG_OBJS_M)
|
||||
OBJ_S := $(BASE_OBJ_S) $(BASE_EXT_OBJ) $(DRV_OBJS_S) $(DLG_OBJS_S)
|
||||
|
||||
|
||||
# The target `multi' on the Make command line indicates that we want to
|
||||
|
|
|
@ -103,6 +103,23 @@ ifneq ($(findstring setup,$(MAKECMDGOALS)),)
|
|||
check_platform := 1
|
||||
endif
|
||||
|
||||
# For builds that don't use `./configure' script we need to copy files
|
||||
# from `submodule/dlg' to `src/dlg'
|
||||
#
|
||||
ifeq ($(wildcard src/dlg/dlg.*),)
|
||||
ifeq ($(wildcard submodules/dlg/dlg.*),)
|
||||
$(info Submodule check out in `submodules/dlg' )
|
||||
$(shell git submodule init)
|
||||
$(shell git submodule update)
|
||||
endif
|
||||
|
||||
$(info Copying files from `submodules/dlg' to `src/dlg')
|
||||
$(shell mkdir src/dlg/dlg)
|
||||
$(shell cp submodules/dlg/include/dlg/dlg.h src/dlg/dlg)
|
||||
$(shell cp submodules/dlg/include/dlg/output.h src/dlg/dlg)
|
||||
$(shell cp submodules/dlg/src/dlg/dlg.c src/dlg/)
|
||||
endif
|
||||
|
||||
# Include the automatic host platform detection rules when we need to
|
||||
# check the platform.
|
||||
#
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
# fully.
|
||||
|
||||
AC_INIT([FreeType], [@VERSION@], [freetype@nongnu.org], [freetype])
|
||||
AC_CONFIG_SRCDIR([ftconfig.in])
|
||||
AC_CONFIG_SRCDIR([ftconfig.h.in])
|
||||
|
||||
|
||||
# Don't forget to update `docs/VERSIONS.TXT'!
|
||||
|
@ -109,11 +109,11 @@ AC_CHECK_SIZEOF([long])
|
|||
AC_TYPE_LONG_LONG_INT
|
||||
|
||||
|
||||
# check whether cpp computation of size of int and long in ftconfig.in works
|
||||
# check whether cpp computation of size of int and long in ftconfig.h.in works
|
||||
|
||||
AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.in works])
|
||||
AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.h.in works])
|
||||
orig_CPPFLAGS="${CPPFLAGS}"
|
||||
CPPFLAGS="-I${srcdir} -I. -I${srcdir}/../../include/freetype/config ${CPPFLAGS}"
|
||||
CPPFLAGS="-I${srcdir} -I. -I${srcdir}/../../include ${CPPFLAGS}"
|
||||
|
||||
ac_clean_files=
|
||||
if test ! -f ft2build.h; then
|
||||
|
@ -123,11 +123,11 @@ fi
|
|||
|
||||
cat > conftest.c <<\_ACEOF
|
||||
#include <limits.h>
|
||||
#define FT_CONFIG_OPTIONS_H "ftoption.h"
|
||||
#define FT_CONFIG_STANDARD_LIBRARY_H "ftstdlib.h"
|
||||
#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h>
|
||||
#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h>
|
||||
#define FT_UINT_MAX UINT_MAX
|
||||
#define FT_ULONG_MAX ULONG_MAX
|
||||
#include "ftconfig.in"
|
||||
#include "ftconfig.h.in"
|
||||
_ACEOF
|
||||
echo >> conftest.c "#if FT_SIZEOF_INT == "${ac_cv_sizeof_int}
|
||||
echo >> conftest.c "ac_cpp_ft_sizeof_int="${ac_cv_sizeof_int}
|
||||
|
@ -1158,15 +1158,7 @@ AC_CONFIG_FILES([ftoption.h:${srcdir}/../../include/freetype/config/ftoption.h],
|
|||
rm ftoption.tmp],
|
||||
[FTOPTION_H_SED="$FTOPTION_H_SED"])
|
||||
|
||||
# configuration file -- stay in 8.3 limit
|
||||
#
|
||||
# since #undef doesn't survive in configuration header files we replace
|
||||
# `/undef' with `#undef' after creating the output file
|
||||
|
||||
AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in],
|
||||
[mv ftconfig.h ftconfig.tmp
|
||||
sed 's|/undef|#undef|' < ftconfig.tmp > ftconfig.h
|
||||
rm ftconfig.tmp])
|
||||
AC_CONFIG_HEADERS([ftconfig.h])
|
||||
|
||||
# create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk'
|
||||
# and `builds/unix/unix-cc.mk' that will be used by the build system
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
/****************************************************************************
|
||||
*
|
||||
* ftconfig.h.in
|
||||
*
|
||||
* UNIX-specific configuration file (specification only).
|
||||
*
|
||||
* Copyright (C) 1996-2020 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* This header file contains a number of macro definitions that are used by
|
||||
* the rest of the engine. Most of the macros here are automatically
|
||||
* determined at compile time, and you should not need to change it to port
|
||||
* FreeType, except to compile the library with a non-ANSI compiler.
|
||||
*
|
||||
* Note however that if some specific modifications are needed, we advise
|
||||
* you to place a modified copy in your build directory.
|
||||
*
|
||||
* The build directory is usually `builds/<system>`, and contains
|
||||
* system-specific files that are always included first when building the
|
||||
* library.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef FTCONFIG_H_
|
||||
#define FTCONFIG_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_OPTIONS_H
|
||||
#include FT_CONFIG_STANDARD_LIBRARY_H
|
||||
|
||||
#undef HAVE_UNISTD_H
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
#undef FT_USE_AUTOCONF_SIZEOF_TYPES
|
||||
#ifdef FT_USE_AUTOCONF_SIZEOF_TYPES
|
||||
|
||||
#undef SIZEOF_INT
|
||||
#undef SIZEOF_LONG
|
||||
#define FT_SIZEOF_INT SIZEOF_INT
|
||||
#define FT_SIZEOF_LONG SIZEOF_LONG
|
||||
|
||||
#endif /* FT_USE_AUTOCONF_SIZEOF_TYPES */
|
||||
|
||||
#include <freetype/config/integer-types.h>
|
||||
#include <freetype/config/public-macros.h>
|
||||
#include <freetype/config/mac-support.h>
|
||||
|
||||
#endif /* FTCONFIG_H_ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,602 +0,0 @@
|
|||
/****************************************************************************
|
||||
*
|
||||
* ftconfig.in
|
||||
*
|
||||
* UNIX-specific configuration file (specification only).
|
||||
*
|
||||
* Copyright (C) 1996-2020 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* This header file contains a number of macro definitions that are used by
|
||||
* the rest of the engine. Most of the macros here are automatically
|
||||
* determined at compile time, and you should not need to change it to port
|
||||
* FreeType, except to compile the library with a non-ANSI compiler.
|
||||
*
|
||||
* Note however that if some specific modifications are needed, we advise
|
||||
* you to place a modified copy in your build directory.
|
||||
*
|
||||
* The build directory is usually `builds/<system>`, and contains
|
||||
* system-specific files that are always included first when building the
|
||||
* library.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef FTCONFIG_H_
|
||||
#define FTCONFIG_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_OPTIONS_H
|
||||
#include FT_CONFIG_STANDARD_LIBRARY_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* PLATFORM-SPECIFIC CONFIGURATION MACROS
|
||||
*
|
||||
* These macros can be toggled to suit a specific system. The current ones
|
||||
* are defaults used to compile FreeType in an ANSI C environment (16bit
|
||||
* compilers are also supported). Copy this file to your own
|
||||
* `builds/<system>` directory, and edit it to port the engine.
|
||||
*
|
||||
*/
|
||||
|
||||
#undef HAVE_UNISTD_H
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* There are systems (like the Texas Instruments 'C54x) where a `char` */
|
||||
/* has 16~bits. ANSI~C says that `sizeof(char)` is always~1. Since an */
|
||||
/* `int` has 16~bits also for this system, `sizeof(int)` gives~1 which */
|
||||
/* is probably unexpected. */
|
||||
/* */
|
||||
/* `CHAR_BIT` (defined in `limits.h`) gives the number of bits in a */
|
||||
/* `char` type. */
|
||||
|
||||
#ifndef FT_CHAR_BIT
|
||||
#define FT_CHAR_BIT CHAR_BIT
|
||||
#endif
|
||||
|
||||
|
||||
#undef FT_USE_AUTOCONF_SIZEOF_TYPES
|
||||
#ifdef FT_USE_AUTOCONF_SIZEOF_TYPES
|
||||
|
||||
#undef SIZEOF_INT
|
||||
#undef SIZEOF_LONG
|
||||
#define FT_SIZEOF_INT SIZEOF_INT
|
||||
#define FT_SIZEOF_LONG SIZEOF_LONG
|
||||
|
||||
#else /* !FT_USE_AUTOCONF_SIZEOF_TYPES */
|
||||
|
||||
/* Following cpp computation of the bit length of `int` and `long` */
|
||||
/* is copied from default `include/freetype/config/ftconfig.h`. */
|
||||
/* If any improvement is required for this file, it should be */
|
||||
/* applied to the original header file for the builders that do */
|
||||
/* not use configure script. */
|
||||
|
||||
/* The size of an `int` type. */
|
||||
#if FT_UINT_MAX == 0xFFFFUL
|
||||
#define FT_SIZEOF_INT ( 16 / FT_CHAR_BIT )
|
||||
#elif FT_UINT_MAX == 0xFFFFFFFFUL
|
||||
#define FT_SIZEOF_INT ( 32 / FT_CHAR_BIT )
|
||||
#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL
|
||||
#define FT_SIZEOF_INT ( 64 / FT_CHAR_BIT )
|
||||
#else
|
||||
#error "Unsupported size of `int' type!"
|
||||
#endif
|
||||
|
||||
/* The size of a `long` type. A five-byte `long` (as used e.g. on the */
|
||||
/* DM642) is recognized but avoided. */
|
||||
#if FT_ULONG_MAX == 0xFFFFFFFFUL
|
||||
#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
|
||||
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
|
||||
#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
|
||||
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL
|
||||
#define FT_SIZEOF_LONG ( 64 / FT_CHAR_BIT )
|
||||
#else
|
||||
#error "Unsupported size of `long' type!"
|
||||
#endif
|
||||
|
||||
#endif /* !FT_USE_AUTOCONF_SIZEOF_TYPES */
|
||||
|
||||
/* `FT_UNUSED` indicates that a given parameter is not used -- */
|
||||
/* this is only used to get rid of unpleasant compiler warnings. */
|
||||
#ifndef FT_UNUSED
|
||||
#define FT_UNUSED( arg ) ( (arg) = (arg) )
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* AUTOMATIC CONFIGURATION MACROS
|
||||
*
|
||||
* These macros are computed from the ones defined above. Don't touch
|
||||
* their definition, unless you know precisely what you are doing. No
|
||||
* porter should need to mess with them.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Mac support
|
||||
*
|
||||
* This is the only necessary change, so it is defined here instead
|
||||
* providing a new configuration file.
|
||||
*/
|
||||
#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
|
||||
/* No Carbon frameworks for 64bit 10.4.x. */
|
||||
/* `AvailabilityMacros.h` is available since Mac OS X 10.2, */
|
||||
/* so guess the system version by maximum errno before inclusion. */
|
||||
#include <errno.h>
|
||||
#ifdef ECANCELED /* defined since 10.2 */
|
||||
#include "AvailabilityMacros.h"
|
||||
#endif
|
||||
#if defined( __LP64__ ) && \
|
||||
( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
|
||||
/undef FT_MACINTOSH
|
||||
#endif
|
||||
|
||||
#elif defined( __SC__ ) || defined( __MRC__ )
|
||||
/* Classic MacOS compilers */
|
||||
#include "ConditionalMacros.h"
|
||||
#if TARGET_OS_MAC
|
||||
#define FT_MACINTOSH 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Fix compiler warning with sgi compiler. */
|
||||
#if defined( __sgi ) && !defined( __GNUC__ )
|
||||
#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
|
||||
#pragma set woff 3505
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* basic_types
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Int16
|
||||
*
|
||||
* @description:
|
||||
* A typedef for a 16bit signed integer type.
|
||||
*/
|
||||
typedef signed short FT_Int16;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_UInt16
|
||||
*
|
||||
* @description:
|
||||
* A typedef for a 16bit unsigned integer type.
|
||||
*/
|
||||
typedef unsigned short FT_UInt16;
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/* this #if 0 ... #endif clause is for documentation purposes */
|
||||
#if 0
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Int32
|
||||
*
|
||||
* @description:
|
||||
* A typedef for a 32bit signed integer type. The size depends on the
|
||||
* configuration.
|
||||
*/
|
||||
typedef signed XXX FT_Int32;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_UInt32
|
||||
*
|
||||
* A typedef for a 32bit unsigned integer type. The size depends on the
|
||||
* configuration.
|
||||
*/
|
||||
typedef unsigned XXX FT_UInt32;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Int64
|
||||
*
|
||||
* A typedef for a 64bit signed integer type. The size depends on the
|
||||
* configuration. Only defined if there is real 64bit support;
|
||||
* otherwise, it gets emulated with a structure (if necessary).
|
||||
*/
|
||||
typedef signed XXX FT_Int64;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_UInt64
|
||||
*
|
||||
* A typedef for a 64bit unsigned integer type. The size depends on the
|
||||
* configuration. Only defined if there is real 64bit support;
|
||||
* otherwise, it gets emulated with a structure (if necessary).
|
||||
*/
|
||||
typedef unsigned XXX FT_UInt64;
|
||||
|
||||
/* */
|
||||
|
||||
#endif
|
||||
|
||||
#if FT_SIZEOF_INT == 4
|
||||
|
||||
typedef signed int FT_Int32;
|
||||
typedef unsigned int FT_UInt32;
|
||||
|
||||
#elif FT_SIZEOF_LONG == 4
|
||||
|
||||
typedef signed long FT_Int32;
|
||||
typedef unsigned long FT_UInt32;
|
||||
|
||||
#else
|
||||
#error "no 32bit type found -- please check your configuration files"
|
||||
#endif
|
||||
|
||||
|
||||
/* look up an integer type that is at least 32~bits */
|
||||
#if FT_SIZEOF_INT >= 4
|
||||
|
||||
typedef int FT_Fast;
|
||||
typedef unsigned int FT_UFast;
|
||||
|
||||
#elif FT_SIZEOF_LONG >= 4
|
||||
|
||||
typedef long FT_Fast;
|
||||
typedef unsigned long FT_UFast;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* determine whether we have a 64-bit `int` type for platforms without */
|
||||
/* Autoconf */
|
||||
#if FT_SIZEOF_LONG == 8
|
||||
|
||||
/* `FT_LONG64` must be defined if a 64-bit type is available */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long
|
||||
#define FT_UINT64 unsigned long
|
||||
|
||||
/* we handle the LLP64 scheme separately for GCC and clang, */
|
||||
/* suppressing the `long long` warning */
|
||||
#elif ( FT_SIZEOF_LONG == 4 ) && \
|
||||
defined( HAVE_LONG_LONG_INT ) && \
|
||||
defined( __GNUC__ )
|
||||
#pragma GCC diagnostic ignored "-Wlong-long"
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* A 64-bit data type may create compilation problems if you compile in
|
||||
* strict ANSI mode. To avoid them, we disable other 64-bit data types if
|
||||
* `__STDC__` is defined. You can however ignore this rule by defining the
|
||||
* `FT_CONFIG_OPTION_FORCE_INT64` configuration macro.
|
||||
*/
|
||||
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
|
||||
|
||||
#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
|
||||
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
|
||||
|
||||
/* this compiler provides the `__int64` type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 __int64
|
||||
#define FT_UINT64 unsigned __int64
|
||||
|
||||
#elif defined( __BORLANDC__ ) /* Borland C++ */
|
||||
|
||||
/* XXXX: We should probably check the value of `__BORLANDC__` in order */
|
||||
/* to test the compiler version. */
|
||||
|
||||
/* this compiler provides the `__int64` type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 __int64
|
||||
#define FT_UINT64 unsigned __int64
|
||||
|
||||
#elif defined( __WATCOMC__ ) /* Watcom C++ */
|
||||
|
||||
/* Watcom doesn't provide 64-bit data types */
|
||||
|
||||
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
|
||||
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
#elif defined( __GNUC__ )
|
||||
|
||||
/* GCC provides the `long long` type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
#endif /* __STDC_VERSION__ >= 199901L */
|
||||
|
||||
#endif /* FT_SIZEOF_LONG == 8 */
|
||||
|
||||
#ifdef FT_LONG64
|
||||
typedef FT_INT64 FT_Int64;
|
||||
typedef FT_UINT64 FT_UInt64;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _WIN64
|
||||
/* only 64bit Windows uses the LLP64 data model, i.e., */
|
||||
/* 32bit integers, 64bit pointers */
|
||||
#define FT_UINT_TO_POINTER( x ) (void*)(unsigned __int64)(x)
|
||||
#else
|
||||
#define FT_UINT_TO_POINTER( x ) (void*)(unsigned long)(x)
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* miscellaneous
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#define FT_BEGIN_STMNT do {
|
||||
#define FT_END_STMNT } while ( 0 )
|
||||
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
|
||||
|
||||
|
||||
/* `typeof` condition taken from gnulib's `intprops.h` header file */
|
||||
#if ( ( defined( __GNUC__ ) && __GNUC__ >= 2 ) || \
|
||||
( defined( __IBMC__ ) && __IBMC__ >= 1210 && \
|
||||
defined( __IBM__TYPEOF__ ) ) || \
|
||||
( defined( __SUNPRO_C ) && __SUNPRO_C >= 0x5110 && !__STDC__ ) )
|
||||
#define FT_TYPEOF( type ) ( __typeof__ ( type ) )
|
||||
#else
|
||||
#define FT_TYPEOF( type ) /* empty */
|
||||
#endif
|
||||
|
||||
|
||||
/* Use `FT_LOCAL` and `FT_LOCAL_DEF` to declare and define, */
|
||||
/* respectively, a function that gets used only within the scope of a */
|
||||
/* module. Normally, both the header and source code files for such a */
|
||||
/* function are within a single module directory. */
|
||||
/* */
|
||||
/* Intra-module arrays should be tagged with `FT_LOCAL_ARRAY` and */
|
||||
/* `FT_LOCAL_ARRAY_DEF`. */
|
||||
/* */
|
||||
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
|
||||
|
||||
#define FT_LOCAL( x ) static x
|
||||
#define FT_LOCAL_DEF( x ) static x
|
||||
|
||||
#else
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_LOCAL( x ) extern "C" x
|
||||
#define FT_LOCAL_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_LOCAL( x ) extern x
|
||||
#define FT_LOCAL_DEF( x ) x
|
||||
#endif
|
||||
|
||||
#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
|
||||
|
||||
#define FT_LOCAL_ARRAY( x ) extern const x
|
||||
#define FT_LOCAL_ARRAY_DEF( x ) const x
|
||||
|
||||
|
||||
/* Use `FT_BASE` and `FT_BASE_DEF` to declare and define, respectively, */
|
||||
/* functions that are used in more than a single module. In the */
|
||||
/* current setup this implies that the declaration is in a header file */
|
||||
/* in the `include/freetype/internal` directory, and the function body */
|
||||
/* is in a file in `src/base`. */
|
||||
/* */
|
||||
#ifndef FT_BASE
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_BASE( x ) extern "C" x
|
||||
#else
|
||||
#define FT_BASE( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_BASE */
|
||||
|
||||
|
||||
#ifndef FT_BASE_DEF
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_BASE_DEF( x ) x
|
||||
#else
|
||||
#define FT_BASE_DEF( x ) x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_BASE_DEF */
|
||||
|
||||
|
||||
/* When compiling FreeType as a DLL or DSO with hidden visibility */
|
||||
/* some systems/compilers need a special attribute in front OR after */
|
||||
/* the return type of function declarations. */
|
||||
/* */
|
||||
/* Two macros are used within the FreeType source code to define */
|
||||
/* exported library functions: `FT_EXPORT` and `FT_EXPORT_DEF`. */
|
||||
/* */
|
||||
/* - `FT_EXPORT( return_type )` */
|
||||
/* */
|
||||
/* is used in a function declaration, as in */
|
||||
/* */
|
||||
/* ``` */
|
||||
/* FT_EXPORT( FT_Error ) */
|
||||
/* FT_Init_FreeType( FT_Library* alibrary ); */
|
||||
/* ``` */
|
||||
/* */
|
||||
/* - `FT_EXPORT_DEF( return_type )` */
|
||||
/* */
|
||||
/* is used in a function definition, as in */
|
||||
/* */
|
||||
/* ``` */
|
||||
/* FT_EXPORT_DEF( FT_Error ) */
|
||||
/* FT_Init_FreeType( FT_Library* alibrary ) */
|
||||
/* { */
|
||||
/* ... some code ... */
|
||||
/* return FT_Err_Ok; */
|
||||
/* } */
|
||||
/* ``` */
|
||||
/* */
|
||||
/* You can provide your own implementation of `FT_EXPORT` and */
|
||||
/* `FT_EXPORT_DEF` here if you want. */
|
||||
/* */
|
||||
/* To export a variable, use `FT_EXPORT_VAR`. */
|
||||
/* */
|
||||
#ifndef FT_EXPORT
|
||||
|
||||
#ifdef FT2_BUILD_LIBRARY
|
||||
|
||||
#if defined( _WIN32 ) && defined( DLL_EXPORT )
|
||||
#define FT_EXPORT( x ) __declspec( dllexport ) x
|
||||
#elif defined( __GNUC__ ) && __GNUC__ >= 4
|
||||
#define FT_EXPORT( x ) __attribute__(( visibility( "default" ) )) x
|
||||
#elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x550
|
||||
#define FT_EXPORT( x ) __global x
|
||||
#elif defined( __cplusplus )
|
||||
#define FT_EXPORT( x ) extern "C" x
|
||||
#else
|
||||
#define FT_EXPORT( x ) extern x
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#if defined( _WIN32 ) && defined( DLL_IMPORT )
|
||||
#define FT_EXPORT( x ) __declspec( dllimport ) x
|
||||
#elif defined( __cplusplus )
|
||||
#define FT_EXPORT( x ) extern "C" x
|
||||
#else
|
||||
#define FT_EXPORT( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* !FT_EXPORT */
|
||||
|
||||
|
||||
#ifndef FT_EXPORT_DEF
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_EXPORT_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_EXPORT_DEF( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_EXPORT_DEF */
|
||||
|
||||
|
||||
#ifndef FT_EXPORT_VAR
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_EXPORT_VAR( x ) extern "C" x
|
||||
#else
|
||||
#define FT_EXPORT_VAR( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_EXPORT_VAR */
|
||||
|
||||
|
||||
/* The following macros are needed to compile the library with a */
|
||||
/* C++ compiler and with 16bit compilers. */
|
||||
/* */
|
||||
|
||||
/* This is special. Within C++, you must specify `extern "C"` for */
|
||||
/* functions which are used via function pointers, and you also */
|
||||
/* must do that for structures which contain function pointers to */
|
||||
/* assure C linkage -- it's not possible to have (local) anonymous */
|
||||
/* functions which are accessed by (global) function pointers. */
|
||||
/* */
|
||||
/* */
|
||||
/* FT_CALLBACK_DEF is used to _define_ a callback function, */
|
||||
/* located in the same source code file as the structure that uses */
|
||||
/* it. */
|
||||
/* */
|
||||
/* FT_BASE_CALLBACK and FT_BASE_CALLBACK_DEF are used to declare */
|
||||
/* and define a callback function, respectively, in a similar way */
|
||||
/* as FT_BASE and FT_BASE_DEF work. */
|
||||
/* */
|
||||
/* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
|
||||
/* contains pointers to callback functions. */
|
||||
/* */
|
||||
/* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
|
||||
/* that contains pointers to callback functions. */
|
||||
/* */
|
||||
/* */
|
||||
/* Some 16bit compilers have to redefine these macros to insert */
|
||||
/* the infamous `_cdecl` or `__fastcall` declarations. */
|
||||
/* */
|
||||
#ifndef FT_CALLBACK_DEF
|
||||
#ifdef __cplusplus
|
||||
#define FT_CALLBACK_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_CALLBACK_DEF( x ) static x
|
||||
#endif
|
||||
#endif /* FT_CALLBACK_DEF */
|
||||
|
||||
#ifndef FT_BASE_CALLBACK
|
||||
#ifdef __cplusplus
|
||||
#define FT_BASE_CALLBACK( x ) extern "C" x
|
||||
#define FT_BASE_CALLBACK_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_BASE_CALLBACK( x ) extern x
|
||||
#define FT_BASE_CALLBACK_DEF( x ) x
|
||||
#endif
|
||||
#endif /* FT_BASE_CALLBACK */
|
||||
|
||||
#ifndef FT_CALLBACK_TABLE
|
||||
#ifdef __cplusplus
|
||||
#define FT_CALLBACK_TABLE extern "C"
|
||||
#define FT_CALLBACK_TABLE_DEF extern "C"
|
||||
#else
|
||||
#define FT_CALLBACK_TABLE extern
|
||||
#define FT_CALLBACK_TABLE_DEF /* nothing */
|
||||
#endif
|
||||
#endif /* FT_CALLBACK_TABLE */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* FTCONFIG_H_ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -351,7 +351,7 @@
|
|||
stream->read = 0;
|
||||
|
||||
FT_TRACE1(( "FT_Stream_Open:" ));
|
||||
FT_TRACE1(( " opened `%s' (%d bytes) successfully\n",
|
||||
FT_TRACE1(( " opened `%s' (%ld bytes) successfully\n",
|
||||
filepathname, stream->size ));
|
||||
|
||||
return FT_Err_Ok;
|
||||
|
|
|
@ -79,7 +79,7 @@ T := -o$(space)
|
|||
# We use our own FreeType configuration files overriding defaults.
|
||||
#
|
||||
CPPFLAGS := @CPPFLAGS@
|
||||
CFLAGS := -c @XX_CFLAGS@ @CFLAGS@ \
|
||||
CFLAGS := -c -std=c99 @XX_CFLAGS@ @CFLAGS@ \
|
||||
$DFT_CONFIG_CONFIG_H="<ftconfig.h>" \
|
||||
$DFT_CONFIG_MODULES_H="<ftmodule.h>" \
|
||||
$DFT_CONFIG_OPTIONS_H="<ftoption.h>"
|
||||
|
|
|
@ -39,21 +39,6 @@
|
|||
#include FT_CONFIG_OPTIONS_H
|
||||
#include FT_CONFIG_STANDARD_LIBRARY_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* PLATFORM-SPECIFIC CONFIGURATION MACROS
|
||||
*
|
||||
* These macros can be toggled to suit a specific system. The current ones
|
||||
* are defaults used to compile FreeType in an ANSI C environment (16bit
|
||||
* compilers are also supported). Copy this file to your own
|
||||
* `builds/<system>` directory, and edit it to port the engine.
|
||||
*
|
||||
*/
|
||||
|
||||
#define HAVE_UNISTD_H 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
|
@ -63,491 +48,9 @@ FT_BEGIN_HEADER
|
|||
#define FT_SIZEOF_INT 4
|
||||
#define FT_SIZEOF_LONG 4
|
||||
|
||||
|
||||
/* `FT_UNUSED` indicates that a given parameter is not used -- */
|
||||
/* this is only used to get rid of unpleasant compiler warnings. */
|
||||
#ifndef FT_UNUSED
|
||||
#define FT_UNUSED( arg ) ( (arg) = (arg) )
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* AUTOMATIC CONFIGURATION MACROS
|
||||
*
|
||||
* These macros are computed from the ones defined above. Don't touch
|
||||
* their definition, unless you know precisely what you are doing. No
|
||||
* porter should need to mess with them.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Mac support
|
||||
*
|
||||
* This is the only necessary change, so it is defined here instead
|
||||
* providing a new configuration file.
|
||||
*/
|
||||
#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
|
||||
/* No Carbon frameworks for 64bit 10.4.x. */
|
||||
/* `AvailabilityMacros.h` is available since Mac OS X 10.2, */
|
||||
/* so guess the system version by maximum errno before inclusion. */
|
||||
#include <errno.h>
|
||||
#ifdef ECANCELED /* defined since 10.2 */
|
||||
#include "AvailabilityMacros.h"
|
||||
#endif
|
||||
#if defined( __LP64__ ) && \
|
||||
( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
|
||||
#undef FT_MACINTOSH
|
||||
#endif
|
||||
|
||||
#elif defined( __SC__ ) || defined( __MRC__ )
|
||||
/* Classic MacOS compilers */
|
||||
#include "ConditionalMacros.h"
|
||||
#if TARGET_OS_MAC
|
||||
#define FT_MACINTOSH 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Fix compiler warning with sgi compiler. */
|
||||
#if defined( __sgi ) && !defined( __GNUC__ )
|
||||
#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
|
||||
#pragma set woff 3505
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* basic_types
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Int16
|
||||
*
|
||||
* @description:
|
||||
* A typedef for a 16bit signed integer type.
|
||||
*/
|
||||
typedef signed short FT_Int16;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_UInt16
|
||||
*
|
||||
* @description:
|
||||
* A typedef for a 16bit unsigned integer type.
|
||||
*/
|
||||
typedef unsigned short FT_UInt16;
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/* this #if 0 ... #endif clause is for documentation purposes */
|
||||
#if 0
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Int32
|
||||
*
|
||||
* @description:
|
||||
* A typedef for a 32bit signed integer type. The size depends on the
|
||||
* configuration.
|
||||
*/
|
||||
typedef signed XXX FT_Int32;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_UInt32
|
||||
*
|
||||
* A typedef for a 32bit unsigned integer type. The size depends on the
|
||||
* configuration.
|
||||
*/
|
||||
typedef unsigned XXX FT_UInt32;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Int64
|
||||
*
|
||||
* A typedef for a 64bit signed integer type. The size depends on the
|
||||
* configuration. Only defined if there is real 64bit support;
|
||||
* otherwise, it gets emulated with a structure (if necessary).
|
||||
*/
|
||||
typedef signed XXX FT_Int64;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_UInt64
|
||||
*
|
||||
* A typedef for a 64bit unsigned integer type. The size depends on the
|
||||
* configuration. Only defined if there is real 64bit support;
|
||||
* otherwise, it gets emulated with a structure (if necessary).
|
||||
*/
|
||||
typedef unsigned XXX FT_UInt64;
|
||||
|
||||
/* */
|
||||
|
||||
#endif
|
||||
|
||||
#if FT_SIZEOF_INT == 4
|
||||
|
||||
typedef signed int FT_Int32;
|
||||
typedef unsigned int FT_UInt32;
|
||||
|
||||
#elif FT_SIZEOF_LONG == 4
|
||||
|
||||
typedef signed long FT_Int32;
|
||||
typedef unsigned long FT_UInt32;
|
||||
|
||||
#else
|
||||
#error "no 32bit type found -- please check your configuration files"
|
||||
#endif
|
||||
|
||||
|
||||
/* look up an integer type that is at least 32~bits */
|
||||
#if FT_SIZEOF_INT >= 4
|
||||
|
||||
typedef int FT_Fast;
|
||||
typedef unsigned int FT_UFast;
|
||||
|
||||
#elif FT_SIZEOF_LONG >= 4
|
||||
|
||||
typedef long FT_Fast;
|
||||
typedef unsigned long FT_UFast;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* determine whether we have a 64-bit `int` type for platforms without */
|
||||
/* Autoconf */
|
||||
#if FT_SIZEOF_LONG == 8
|
||||
|
||||
/* `FT_LONG64` must be defined if a 64-bit type is available */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long
|
||||
#define FT_UINT64 unsigned long
|
||||
|
||||
/* we handle the LLP64 scheme separately for GCC and clang, */
|
||||
/* suppressing the `long long` warning */
|
||||
#elif ( FT_SIZEOF_LONG == 4 ) && \
|
||||
defined( HAVE_LONG_LONG_INT ) && \
|
||||
defined( __GNUC__ )
|
||||
#pragma GCC diagnostic ignored "-Wlong-long"
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* A 64-bit data type may create compilation problems if you compile in
|
||||
* strict ANSI mode. To avoid them, we disable other 64-bit data types if
|
||||
* `__STDC__` is defined. You can however ignore this rule by defining the
|
||||
* `FT_CONFIG_OPTION_FORCE_INT64` configuration macro.
|
||||
*/
|
||||
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
|
||||
|
||||
#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
|
||||
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
|
||||
|
||||
/* this compiler provides the `__int64` type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 __int64
|
||||
#define FT_UINT64 unsigned __int64
|
||||
|
||||
#elif defined( __BORLANDC__ ) /* Borland C++ */
|
||||
|
||||
/* XXXX: We should probably check the value of `__BORLANDC__` in order */
|
||||
/* to test the compiler version. */
|
||||
|
||||
/* this compiler provides the `__int64` type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 __int64
|
||||
#define FT_UINT64 unsigned __int64
|
||||
|
||||
#elif defined( __WATCOMC__ ) /* Watcom C++ */
|
||||
|
||||
/* Watcom doesn't provide 64-bit data types */
|
||||
|
||||
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
|
||||
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
#elif defined( __GNUC__ )
|
||||
|
||||
/* GCC provides the `long long` type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
#endif /* __STDC_VERSION__ >= 199901L */
|
||||
|
||||
#endif /* FT_SIZEOF_LONG == 8 */
|
||||
|
||||
#ifdef FT_LONG64
|
||||
typedef FT_INT64 FT_Int64;
|
||||
typedef FT_UINT64 FT_UInt64;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _WIN64
|
||||
/* only 64bit Windows uses the LLP64 data model, i.e., */
|
||||
/* 32bit integers, 64bit pointers */
|
||||
#define FT_UINT_TO_POINTER( x ) (void*)(unsigned __int64)(x)
|
||||
#else
|
||||
#define FT_UINT_TO_POINTER( x ) (void*)(unsigned long)(x)
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* miscellaneous
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#define FT_BEGIN_STMNT do {
|
||||
#define FT_END_STMNT } while ( 0 )
|
||||
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
|
||||
|
||||
|
||||
/* `typeof` condition taken from gnulib's `intprops.h` header file */
|
||||
#if ( ( defined( __GNUC__ ) && __GNUC__ >= 2 ) || \
|
||||
( defined( __IBMC__ ) && __IBMC__ >= 1210 && \
|
||||
defined( __IBM__TYPEOF__ ) ) || \
|
||||
( defined( __SUNPRO_C ) && __SUNPRO_C >= 0x5110 && !__STDC__ ) )
|
||||
#define FT_TYPEOF( type ) ( __typeof__ ( type ) )
|
||||
#else
|
||||
#define FT_TYPEOF( type ) /* empty */
|
||||
#endif
|
||||
|
||||
|
||||
/* Use `FT_LOCAL` and `FT_LOCAL_DEF` to declare and define, */
|
||||
/* respectively, a function that gets used only within the scope of a */
|
||||
/* module. Normally, both the header and source code files for such a */
|
||||
/* function are within a single module directory. */
|
||||
/* */
|
||||
/* Intra-module arrays should be tagged with `FT_LOCAL_ARRAY` and */
|
||||
/* `FT_LOCAL_ARRAY_DEF`. */
|
||||
/* */
|
||||
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
|
||||
|
||||
#define FT_LOCAL( x ) static x
|
||||
#define FT_LOCAL_DEF( x ) static x
|
||||
|
||||
#else
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_LOCAL( x ) extern "C" x
|
||||
#define FT_LOCAL_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_LOCAL( x ) extern x
|
||||
#define FT_LOCAL_DEF( x ) x
|
||||
#endif
|
||||
|
||||
#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
|
||||
|
||||
#define FT_LOCAL_ARRAY( x ) extern const x
|
||||
#define FT_LOCAL_ARRAY_DEF( x ) const x
|
||||
|
||||
|
||||
/* Use `FT_BASE` and `FT_BASE_DEF` to declare and define, respectively, */
|
||||
/* functions that are used in more than a single module. In the */
|
||||
/* current setup this implies that the declaration is in a header file */
|
||||
/* in the `include/freetype/internal` directory, and the function body */
|
||||
/* is in a file in `src/base`. */
|
||||
/* */
|
||||
#ifndef FT_BASE
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_BASE( x ) extern "C" x
|
||||
#else
|
||||
#define FT_BASE( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_BASE */
|
||||
|
||||
|
||||
#ifndef FT_BASE_DEF
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_BASE_DEF( x ) x
|
||||
#else
|
||||
#define FT_BASE_DEF( x ) x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_BASE_DEF */
|
||||
|
||||
|
||||
/* When compiling FreeType as a DLL or DSO with hidden visibility */
|
||||
/* some systems/compilers need a special attribute in front OR after */
|
||||
/* the return type of function declarations. */
|
||||
/* */
|
||||
/* Two macros are used within the FreeType source code to define */
|
||||
/* exported library functions: `FT_EXPORT` and `FT_EXPORT_DEF`. */
|
||||
/* */
|
||||
/* - `FT_EXPORT( return_type )` */
|
||||
/* */
|
||||
/* is used in a function declaration, as in */
|
||||
/* */
|
||||
/* ``` */
|
||||
/* FT_EXPORT( FT_Error ) */
|
||||
/* FT_Init_FreeType( FT_Library* alibrary ); */
|
||||
/* ``` */
|
||||
/* */
|
||||
/* - `FT_EXPORT_DEF( return_type )` */
|
||||
/* */
|
||||
/* is used in a function definition, as in */
|
||||
/* */
|
||||
/* ``` */
|
||||
/* FT_EXPORT_DEF( FT_Error ) */
|
||||
/* FT_Init_FreeType( FT_Library* alibrary ) */
|
||||
/* { */
|
||||
/* ... some code ... */
|
||||
/* return FT_Err_Ok; */
|
||||
/* } */
|
||||
/* ``` */
|
||||
/* */
|
||||
/* You can provide your own implementation of `FT_EXPORT` and */
|
||||
/* `FT_EXPORT_DEF` here if you want. */
|
||||
/* */
|
||||
/* To export a variable, use `FT_EXPORT_VAR`. */
|
||||
/* */
|
||||
#ifndef FT_EXPORT
|
||||
|
||||
#ifdef FT2_BUILD_LIBRARY
|
||||
|
||||
#if defined( _WIN32 ) && defined( DLL_EXPORT )
|
||||
#define FT_EXPORT( x ) __declspec( dllexport ) x
|
||||
#elif defined( __GNUC__ ) && __GNUC__ >= 4
|
||||
#define FT_EXPORT( x ) __attribute__(( visibility( "default" ) )) x
|
||||
#elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x550
|
||||
#define FT_EXPORT( x ) __global x
|
||||
#elif defined( __cplusplus )
|
||||
#define FT_EXPORT( x ) extern "C" x
|
||||
#else
|
||||
#define FT_EXPORT( x ) extern x
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#if defined( _WIN32 ) && defined( DLL_IMPORT )
|
||||
#define FT_EXPORT( x ) __declspec( dllimport ) x
|
||||
#elif defined( __cplusplus )
|
||||
#define FT_EXPORT( x ) extern "C" x
|
||||
#else
|
||||
#define FT_EXPORT( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* !FT_EXPORT */
|
||||
|
||||
|
||||
#ifndef FT_EXPORT_DEF
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_EXPORT_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_EXPORT_DEF( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_EXPORT_DEF */
|
||||
|
||||
|
||||
#ifndef FT_EXPORT_VAR
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_EXPORT_VAR( x ) extern "C" x
|
||||
#else
|
||||
#define FT_EXPORT_VAR( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_EXPORT_VAR */
|
||||
|
||||
|
||||
/* The following macros are needed to compile the library with a */
|
||||
/* C++ compiler and with 16bit compilers. */
|
||||
/* */
|
||||
|
||||
/* This is special. Within C++, you must specify `extern "C"` for */
|
||||
/* functions which are used via function pointers, and you also */
|
||||
/* must do that for structures which contain function pointers to */
|
||||
/* assure C linkage -- it's not possible to have (local) anonymous */
|
||||
/* functions which are accessed by (global) function pointers. */
|
||||
/* */
|
||||
/* */
|
||||
/* FT_CALLBACK_DEF is used to _define_ a callback function, */
|
||||
/* located in the same source code file as the structure that uses */
|
||||
/* it. */
|
||||
/* */
|
||||
/* FT_BASE_CALLBACK and FT_BASE_CALLBACK_DEF are used to declare */
|
||||
/* and define a callback function, respectively, in a similar way */
|
||||
/* as FT_BASE and FT_BASE_DEF work. */
|
||||
/* */
|
||||
/* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
|
||||
/* contains pointers to callback functions. */
|
||||
/* */
|
||||
/* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
|
||||
/* that contains pointers to callback functions. */
|
||||
/* */
|
||||
/* */
|
||||
/* Some 16bit compilers have to redefine these macros to insert */
|
||||
/* the infamous `_cdecl` or `__fastcall` declarations. */
|
||||
/* */
|
||||
#ifndef FT_CALLBACK_DEF
|
||||
#ifdef __cplusplus
|
||||
#define FT_CALLBACK_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_CALLBACK_DEF( x ) static x
|
||||
#endif
|
||||
#endif /* FT_CALLBACK_DEF */
|
||||
|
||||
#ifndef FT_BASE_CALLBACK
|
||||
#ifdef __cplusplus
|
||||
#define FT_BASE_CALLBACK( x ) extern "C" x
|
||||
#define FT_BASE_CALLBACK_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_BASE_CALLBACK( x ) extern x
|
||||
#define FT_BASE_CALLBACK_DEF( x ) x
|
||||
#endif
|
||||
#endif /* FT_BASE_CALLBACK */
|
||||
|
||||
#ifndef FT_CALLBACK_TABLE
|
||||
#ifdef __cplusplus
|
||||
#define FT_CALLBACK_TABLE extern "C"
|
||||
#define FT_CALLBACK_TABLE_DEF extern "C"
|
||||
#else
|
||||
#define FT_CALLBACK_TABLE extern
|
||||
#define FT_CALLBACK_TABLE_DEF /* nothing */
|
||||
#endif
|
||||
#endif /* FT_CALLBACK_TABLE */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#include <freetype/config/integer-types.h>
|
||||
#include <freetype/config/public-macros.h>
|
||||
#include <freetype/config/mac-support.h>
|
||||
|
||||
#endif /* FTCONFIG_H_ */
|
||||
|
||||
|
|
|
@ -0,0 +1,165 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug Static|Win32">
|
||||
<Configuration>Debug Static</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug Static|x64">
|
||||
<Configuration>Debug Static</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{f15a5e7b-f721-4d61-9573-19aee9177027}</ProjectGuid>
|
||||
<RootNamespace>dlg</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>..\..\..\objs\$(Platform)\$(Configuration)\dlg\</OutDir>
|
||||
<IntDir>..\..\..\objs\$(Platform)\$(Configuration)\dlg\</IntDir>
|
||||
<TargetName>dlg</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>..\..\..\objs\$(Platform)\$(Configuration)\dlg\</OutDir>
|
||||
<IntDir>..\..\..\objs\$(Platform)\$(Configuration)\dlg\</IntDir>
|
||||
<TargetName>dlg</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>..\..\..\objs\$(Platform)\$(Configuration)\dlg\</OutDir>
|
||||
<IntDir>..\..\..\objs\$(Platform)\$(Configuration)\dlg\</IntDir>
|
||||
<TargetName>dlg</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>..\..\..\objs\$(Platform)\$(Configuration)\dlg\</OutDir>
|
||||
<IntDir>..\..\..\objs\$(Platform)\$(Configuration)\dlg\</IntDir>
|
||||
<TargetName>dlg</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>..\..\..\src\dlg\</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>call $(ProjectDir)script.bat</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>DLG_STATIC;WIN32;_DEBUG;_CONSOLE%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>..\..\..\src\dlg\</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>call $(ProjectDir)script.bat</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>..\..\..\src\dlg\</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>call $(ProjectDir)script.bat</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>DLG_STATIC;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>..\..\..\src\dlg\</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>call $(ProjectDir)script.bat</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\src\dlg\dlg.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\src\dlg\dlg.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,11 @@
|
|||
@echo OFF
|
||||
|
||||
:: Move to Top Dir
|
||||
cd ..\..\..\
|
||||
|
||||
:: Copy dlg's files from `submodules\dlg' to `src\dlg'
|
||||
IF NOT EXIST src\dlg\dlg (
|
||||
mkdir src\dlg\dlg
|
||||
COPY submodules\dlg\include\dlg\dlg.h src\dlg\dlg
|
||||
COPY submodules\dlg\include\dlg\output.h src\dlg\dlg
|
||||
COPY submodules\dlg\src\dlg\dlg.c src\dlg\ )
|
|
@ -44,6 +44,46 @@
|
|||
#include <freetype/freetype.h>
|
||||
#include <freetype/internal/ftdebug.h>
|
||||
|
||||
#ifdef FT_LOGGING
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Variable used when FT_LOGGING is enabled to control logging:
|
||||
*
|
||||
* 1. ft_default_trace_level: stores the value of trace levels which are
|
||||
* provided to FreeType using FT2_DEBUG environment variable.
|
||||
*
|
||||
* 2. ft_custom_trace_level: stores the value of custom trace level which
|
||||
* is provided by user at run-time.
|
||||
*
|
||||
* 3. ft_component: a string that holds the name of FT_COMPONENT
|
||||
*
|
||||
* 4. ft_fileptr: store the FILE*
|
||||
*
|
||||
* 5. ft_component_flag: a flag when is true, prints FT_COMPONENT along
|
||||
* with log message if `-v` is defined in FT2_DEBUG
|
||||
* 6. ft_timestamp_flag: a flag when is true, prints time in millisec along
|
||||
* with log message if `-t` is define in FT2_DEBUG
|
||||
* 7. ft_have_newline_char: It is used to differentiate between a log
|
||||
* message with '\n' char and log message without '\n' char
|
||||
*
|
||||
* Static Variables are defined here to remove [ -Wunused-variable ]
|
||||
* warning
|
||||
*
|
||||
*/
|
||||
static const char* ft_default_trace_level = NULL;
|
||||
static const char* ft_custom_trace_level = NULL;
|
||||
static const char* ft_component = NULL;
|
||||
static FILE* ft_fileptr = NULL;
|
||||
static bool ft_component_flag = false;
|
||||
static bool ft_timestamp_flag = false;
|
||||
static bool ft_have_newline_char = true;
|
||||
|
||||
FT_Custom_Log_Handler custom_output_handler = NULL;
|
||||
dlg_handler ft_default_log_handler = NULL;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_ERROR
|
||||
|
||||
|
@ -207,7 +247,18 @@
|
|||
FT_BASE_DEF( void )
|
||||
ft_debug_init( void )
|
||||
{
|
||||
const char* ft2_debug = getenv( "FT2_DEBUG" );
|
||||
const char* ft2_debug = NULL;
|
||||
|
||||
#ifdef FT_LOGGING
|
||||
|
||||
if( ft_custom_trace_level != NULL )
|
||||
ft2_debug = ft_custom_trace_level;
|
||||
else
|
||||
ft2_debug = ft_default_trace_level;
|
||||
|
||||
#else
|
||||
ft2_debug = ft_getenv( "FT2_DEBUG" );
|
||||
#endif /* FT_LOGGIGN */
|
||||
|
||||
|
||||
if ( ft2_debug )
|
||||
|
@ -218,10 +269,40 @@
|
|||
|
||||
for ( ; *p; p++ )
|
||||
{
|
||||
|
||||
/* skip leading whitespace and separators */
|
||||
if ( *p == ' ' || *p == '\t' || *p == ',' || *p == ';' || *p == '=' )
|
||||
continue;
|
||||
|
||||
#ifdef FT_LOGGING
|
||||
/* check extra arguments for logging */
|
||||
if( *p == '-' )
|
||||
{
|
||||
const char* r = ++p;
|
||||
if( *r == 'v' )
|
||||
{
|
||||
ft_component_flag = true;
|
||||
const char* s = ++r;
|
||||
if( *s == 't' )
|
||||
{
|
||||
ft_timestamp_flag = true;
|
||||
p++;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
else if( *r == 't' )
|
||||
{
|
||||
ft_timestamp_flag = true;
|
||||
const char* s = ++r;
|
||||
if( *s == 'v' )
|
||||
{
|
||||
ft_component_flag = true;
|
||||
p++;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* read toggle name, followed by ':' */
|
||||
q = p;
|
||||
while ( *p && *p != ':' )
|
||||
|
@ -281,7 +362,6 @@
|
|||
ft_trace_levels = ft_trace_levels_enabled;
|
||||
}
|
||||
|
||||
|
||||
#else /* !FT_DEBUG_LEVEL_TRACE */
|
||||
|
||||
|
||||
|
@ -327,4 +407,150 @@
|
|||
#endif /* !FT_DEBUG_LEVEL_TRACE */
|
||||
|
||||
|
||||
#ifdef FT_LOGGING
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* If FT_LOGGING is enabled, FreeType needs to initialize all logging
|
||||
* variables to write logs.
|
||||
* Therefore it uses `ft_logging_init()` function to initialize a
|
||||
* loggging variables and `ft_logging_deinit()` to un-initialize the
|
||||
* logging variables.
|
||||
*
|
||||
*/
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
ft_logging_init( void )
|
||||
{
|
||||
ft_default_log_handler = ft_log_handler;
|
||||
ft_default_trace_level = ft_getenv( "FT2_DEBUG" );
|
||||
if( ft_getenv( "FT_LOGGING_FILE" ) )
|
||||
ft_fileptr = fopen( ft_getenv( "FT_LOGGING_FILE" ) , "w" );
|
||||
else
|
||||
ft_fileptr = stderr;
|
||||
|
||||
ft_debug_init();
|
||||
/* We need to set the default FreeType specific dlg's output handler */
|
||||
dlg_set_handler( ft_default_log_handler, NULL );
|
||||
|
||||
}
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
ft_logging_deinit( void )
|
||||
{
|
||||
fclose( ft_fileptr );
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* TODO:
|
||||
* 1. Add support for priniting FT_COMPONENT
|
||||
*
|
||||
*/
|
||||
FT_BASE_DEF( void )
|
||||
ft_log_handler( const struct dlg_origin* origin,
|
||||
const char* string, void* data )
|
||||
{
|
||||
( void ) data;
|
||||
const char* features ;
|
||||
if( ft_timestamp_flag && ft_component_flag && ft_have_newline_char )
|
||||
features = "[%h:%m %t] %c";
|
||||
else if( ft_component_flag && ft_have_newline_char)
|
||||
features = "[%t] %c";
|
||||
else if( ft_timestamp_flag && ft_have_newline_char )
|
||||
features = "[%t] %c";
|
||||
else
|
||||
features = "%c";
|
||||
|
||||
dlg_generic_outputf_stream( ft_fileptr, features, origin, string,
|
||||
dlg_default_output_styles, true );
|
||||
|
||||
if( strchr( string, '\n' ) )
|
||||
ft_have_newline_char = true;
|
||||
else
|
||||
ft_have_newline_char = false;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Functions to set trace levels at run-time
|
||||
* 1. FT_Trace_Set_Level() - Use this function to change the trace level
|
||||
* at run-time. e.g. FT_Trace_Set_Level( "any:6 io:2" );
|
||||
*
|
||||
* 2. FT_Trace_Set_Default_Level() - Use this function to set the default
|
||||
* value of trace levels which is provided by environment variable
|
||||
* FT2_DEBUG
|
||||
*
|
||||
*/
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
FT_Trace_Set_Level( const char* level )
|
||||
{
|
||||
ft_custom_trace_level = level;
|
||||
ft_debug_init();
|
||||
}
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
FT_Trace_Set_Default_Level( void )
|
||||
{
|
||||
ft_custom_trace_level = NULL ;
|
||||
ft_debug_init();
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Functions to handle custom log handler:
|
||||
*
|
||||
*/
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
FT_Set_Log_Handler( FT_Custom_Log_Handler handler )
|
||||
{
|
||||
custom_output_handler = handler;
|
||||
}
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
FT_Set_Default_Log_Handler()
|
||||
{
|
||||
custom_output_handler = NULL;
|
||||
}
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
FT_Callback( const char* fmt, ... )
|
||||
{
|
||||
va_list ap;
|
||||
va_start( ap, fmt );
|
||||
custom_output_handler( ft_component , fmt, ap );
|
||||
va_end( ap );
|
||||
}
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
ft_add_tag( const char* tag )
|
||||
{
|
||||
ft_component = tag;
|
||||
dlg_add_tag( tag, NULL );
|
||||
}
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
ft_remove_tag( const char* tag )
|
||||
{
|
||||
dlg_remove_tag( tag, NULL );
|
||||
}
|
||||
|
||||
#else /* ! FT_LOGGING */
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
ft_add_tag( const char* tag )
|
||||
{
|
||||
/* nothing */
|
||||
}
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
ft_remove_tag( const char* tag )
|
||||
{
|
||||
/* nothing */
|
||||
}
|
||||
|
||||
#endif /* FT_LOGGING*/
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -1,37 +1,56 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio Express 2012 for Windows Desktop
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30204.135
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "freetype.vcxproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dlg", "..\dlg\dlg.vcxproj", "{F15A5E7B-F721-4D61-9573-19AEE9177027}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Debug Static|Win32 = Debug Static|Win32
|
||||
Debug Static|x64 = Debug Static|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release Static|Win32 = Release Static|Win32
|
||||
Release Static|x64 = Release Static|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.Build.0 = Debug|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Static|Win32.ActiveCfg = Debug Static|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Static|Win32.Build.0 = Debug Static|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Static|x64.ActiveCfg = Debug Static|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Static|x64.Build.0 = Debug Static|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.Build.0 = Release|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.ActiveCfg = Release|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.Build.0 = Release|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.Build.0 = Debug|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Static|Win32.ActiveCfg = Release Static|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Static|Win32.Build.0 = Release Static|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Static|x64.ActiveCfg = Release Static|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Static|x64.Build.0 = Release Static|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.Build.0 = Release|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.ActiveCfg = Release|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.Build.0 = Release|x64
|
||||
{F15A5E7B-F721-4D61-9573-19AEE9177027}.Debug Static|Win32.ActiveCfg = Debug Static|Win32
|
||||
{F15A5E7B-F721-4D61-9573-19AEE9177027}.Debug Static|Win32.Build.0 = Debug Static|Win32
|
||||
{F15A5E7B-F721-4D61-9573-19AEE9177027}.Debug Static|x64.ActiveCfg = Debug Static|x64
|
||||
{F15A5E7B-F721-4D61-9573-19AEE9177027}.Debug Static|x64.Build.0 = Debug Static|x64
|
||||
{F15A5E7B-F721-4D61-9573-19AEE9177027}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F15A5E7B-F721-4D61-9573-19AEE9177027}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F15A5E7B-F721-4D61-9573-19AEE9177027}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F15A5E7B-F721-4D61-9573-19AEE9177027}.Debug|x64.Build.0 = Debug|x64
|
||||
{F15A5E7B-F721-4D61-9573-19AEE9177027}.Release Static|Win32.ActiveCfg = Debug Static|Win32
|
||||
{F15A5E7B-F721-4D61-9573-19AEE9177027}.Release Static|x64.ActiveCfg = Debug Static|x64
|
||||
{F15A5E7B-F721-4D61-9573-19AEE9177027}.Release|Win32.ActiveCfg = Debug Static|Win32
|
||||
{F15A5E7B-F721-4D61-9573-19AEE9177027}.Release|x64.ActiveCfg = Debug Static|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {B6413C29-83EB-4BBE-9598-1A96E37515D1}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}</ProjectGuid>
|
||||
<RootNamespace>FreeType</RootNamespace>
|
||||
<ProjectName>
|
||||
</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Label="PlatformToolset">
|
||||
|
@ -89,8 +91,8 @@
|
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;DLL_EXPORT;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\..\src\dlg\;$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;FT_LOGGING;DLL_EXPORT;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<DisableLanguageExtensions>true</DisableLanguageExtensions>
|
||||
|
@ -111,12 +113,16 @@
|
|||
<AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Lib>
|
||||
<Link>
|
||||
<AdditionalLibraryDirectories>..\..\..\objs\$(Platform)\$(Configuration)\dlg\</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>dlg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;DLL_EXPORT;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\..\src\dlg\;$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;DLL_EXPORT;FT_LOGGING;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<DisableLanguageExtensions>true</DisableLanguageExtensions>
|
||||
|
@ -137,12 +143,16 @@
|
|||
<AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Lib>
|
||||
<Link>
|
||||
<AdditionalLibraryDirectories>..\..\..\objs\$(Platform)\$(Configuration)\dlg\</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>dlg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\..\src\dlg\;$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>DLG_STATIC;WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;FT_LOGGING;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<DisableLanguageExtensions>true</DisableLanguageExtensions>
|
||||
|
@ -167,8 +177,8 @@
|
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\..\src\dlg\;$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>DLG_STATIC;WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;FT_LOGGING;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<DisableLanguageExtensions>true</DisableLanguageExtensions>
|
||||
|
@ -348,4 +358,4 @@
|
|||
<Target Name="AfterBuild">
|
||||
<Copy SourceFiles="$(TargetPath)" DestinationFolder="..\..\..\objs" />
|
||||
</Target>
|
||||
</Project>
|
||||
</Project>
|
128
docs/DEBUG
128
docs/DEBUG
|
@ -26,6 +26,34 @@ located in the file `ftoption.h'. The macros are:
|
|||
appropriate `debug level' is configured at runtime through the
|
||||
`FT2_DEBUG' environment variable (more on this later).
|
||||
|
||||
FT_LOGGING
|
||||
|
||||
As mentioned above if `FT_DEBUG_LEVEL_ERROR' and
|
||||
`FT_DEBUG_LEVEL_TRACE' macros are defined, FreeType will send the
|
||||
debug and trace logs outputted from `FT_ERROR' and `FT_TRACE'
|
||||
macros to `stderr'.
|
||||
|
||||
`FT_LOGGING' is a new macro which is introduced to enhance the
|
||||
capabilities of `FT_TRACE' and `FT_ERROR' macros.
|
||||
`FT_LOGGING' macro depends on `FT_DEBUG_LEVEL_TRACE' and
|
||||
`FT_DEBUG_LEVEL_ERROR', therefore these macros will automatically
|
||||
be #defined once `FT_LOGGING' macro is #defined and
|
||||
the behaviour of `FT_TRACE' and `FT_ERROR' macros will change.
|
||||
Now, `FT_TRACE' and `FT_ERROR' macros will start sending the
|
||||
tracing and debugging messages to the file system instead of
|
||||
`stderr'.
|
||||
On the file system the log file will be generated on the path
|
||||
specified using `FT_LOGGING_FILE' environment variable(more on
|
||||
this later).
|
||||
|
||||
There is an additional support of logging Time and the name of
|
||||
the `FT_COMPONENT' from which the current log is generated along
|
||||
with the actual tracing and debugging message, and for this user
|
||||
will have to define additional tags under the `FT2_DEBUG'
|
||||
environment variable(More details under section `FT2_DEBUG' under
|
||||
Environment Variables heading).
|
||||
|
||||
|
||||
FT_DEBUG_MEMORY
|
||||
|
||||
If this macro is #defined, the FreeType engine is linked with a
|
||||
|
@ -150,6 +178,42 @@ behaviour of FreeType at runtime.
|
|||
the memory and io components, which are set to the trace levels 5
|
||||
and 4, respectively.
|
||||
|
||||
`FT_LOGGING' related tags:
|
||||
|
||||
As mentioned above in the `FT_LOGGING' section below are the
|
||||
additional tags which can be added in `FT2_DEBUG' environment
|
||||
variable to log the time and the value of `FT_COMPONENT' in the
|
||||
actual log message:
|
||||
* -v: For printing the name of FreeType's component from which
|
||||
the current log is produced.
|
||||
* -t: For printing the time(in milliseconds) along with actual
|
||||
log message.
|
||||
|
||||
Example:
|
||||
|
||||
Case 1: FT2_DEBUG="any:7 memory:5 -vt"
|
||||
|
||||
[20:32:02:44969 ttload] table directory loaded
|
||||
|
||||
Case 2: FT2_DEBUG="any:7 memory:5 -t"
|
||||
|
||||
[20:32:02:44969 ttload] table directory loaded
|
||||
|
||||
Case 3: FT2_DEBUG="any:7 memory:5 -v"
|
||||
|
||||
[ttload] table directory loaded
|
||||
|
||||
FT_LOGGING_FILE
|
||||
|
||||
This variable is only used when FreeType is built with
|
||||
`FT_LOGGING' macro defined. It contains the path to the file where
|
||||
the user wants to put his log file.
|
||||
|
||||
On Linux with bash:
|
||||
export FT_LOGGING_FILE="/tmp/freetype2.log"
|
||||
|
||||
On Windows:
|
||||
set FT_LOGGING_FILE=C:\Users\AppData\Local\Temp\freetype2.log
|
||||
|
||||
FT2_DEBUG_MEMORY
|
||||
|
||||
|
@ -201,6 +265,70 @@ behaviour of FreeType at runtime.
|
|||
If it is undefined, or if its value is not strictly positive,
|
||||
freed blocks are released at runtime.
|
||||
|
||||
|
||||
IV. Additional Capabilities with `FT_LOGGING'
|
||||
--------------------------------------------
|
||||
|
||||
With the support of `FT_LOGGING', four APIs have been introduced for
|
||||
providing additional debugging support to the applications using
|
||||
FreeType.
|
||||
|
||||
FT_Trace_Set_Level( const char* )
|
||||
|
||||
If FreeType is configured with `FT_LOGGING' the levels of tracing
|
||||
component set using `FT2_DEBUG' environment variable is considered
|
||||
as a default value.
|
||||
And this function can be used change/set the value of the levels
|
||||
of tracing components at run-time.
|
||||
|
||||
NOTE: If the environment variable `FT2_DEBUG is not defined the
|
||||
default value of the levels of tracing components will be NULL.
|
||||
|
||||
FT_Trace_Set_Default_Level():
|
||||
|
||||
If previously, `FT_Trace_Set_Level' functions is used to set new
|
||||
values of the tracing components of FreeType, this function could
|
||||
be used to reset the level of tracing components to the default
|
||||
value.
|
||||
Hence, the functions `FT_Trace_Set_Default_Level' and
|
||||
`FT_Trace_Set_Level' could be combined and used together to
|
||||
change the trace levels of FreeType's components for a particular
|
||||
block of code.
|
||||
|
||||
FT_Set_Log_Handler( ft_custom_log_handler ):
|
||||
|
||||
This API has been provided under the `FT_LOGGING' macro to support
|
||||
a feature wherein a custom log handler can be provided based on
|
||||
user’s choice. Doing so, FreeType will start calling the custom
|
||||
handler for new log messages and will no longer write these
|
||||
messages in predefined log file of FreeType. It will totally
|
||||
depend on user how the log messages will be handled.
|
||||
User just need to call this API with an argument of type
|
||||
ft_custom_log_handler which should match following function
|
||||
prototype:
|
||||
|
||||
void (*ft_custom_log_handler)( const char* ft_component, \
|
||||
const char* fmt, va_list args );
|
||||
|
||||
|
||||
|
||||
FT_Set_Default_Log_Handler():
|
||||
|
||||
If the user has chosen to set a custom log handler using the
|
||||
`FT_Set_Log_Handler' API above, the current API can be used to
|
||||
reset back the log handler to the Freetype's inbuilt log handler.
|
||||
Hence, the functions `FT_Set_Default_Log_Handler' and
|
||||
`FT_Set_Log_Handler' in combination can be used to separately
|
||||
handle the trace or error logs generated by a particular block
|
||||
of code.
|
||||
|
||||
|
||||
Applications need to #include the following header file to avail the
|
||||
above APIs:
|
||||
|
||||
#include<freetype/ftlogging.h>
|
||||
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
Copyright (C) 2002-2020 by
|
||||
|
|
|
@ -41,533 +41,9 @@
|
|||
#include FT_CONFIG_OPTIONS_H
|
||||
#include FT_CONFIG_STANDARD_LIBRARY_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* PLATFORM-SPECIFIC CONFIGURATION MACROS
|
||||
*
|
||||
* These macros can be toggled to suit a specific system. The current ones
|
||||
* are defaults used to compile FreeType in an ANSI C environment (16bit
|
||||
* compilers are also supported). Copy this file to your own
|
||||
* `builds/<system>` directory, and edit it to port the engine.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* There are systems (like the Texas Instruments 'C54x) where a `char` */
|
||||
/* has 16~bits. ANSI~C says that `sizeof(char)` is always~1. Since an */
|
||||
/* `int` has 16~bits also for this system, `sizeof(int)` gives~1 which */
|
||||
/* is probably unexpected. */
|
||||
/* */
|
||||
/* `CHAR_BIT` (defined in `limits.h`) gives the number of bits in a */
|
||||
/* `char` type. */
|
||||
|
||||
#ifndef FT_CHAR_BIT
|
||||
#define FT_CHAR_BIT CHAR_BIT
|
||||
#endif
|
||||
|
||||
|
||||
/* The size of an `int` type. */
|
||||
#if FT_UINT_MAX == 0xFFFFUL
|
||||
#define FT_SIZEOF_INT ( 16 / FT_CHAR_BIT )
|
||||
#elif FT_UINT_MAX == 0xFFFFFFFFUL
|
||||
#define FT_SIZEOF_INT ( 32 / FT_CHAR_BIT )
|
||||
#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL
|
||||
#define FT_SIZEOF_INT ( 64 / FT_CHAR_BIT )
|
||||
#else
|
||||
#error "Unsupported size of `int' type!"
|
||||
#endif
|
||||
|
||||
/* The size of a `long` type. A five-byte `long` (as used e.g. on the */
|
||||
/* DM642) is recognized but avoided. */
|
||||
#if FT_ULONG_MAX == 0xFFFFFFFFUL
|
||||
#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
|
||||
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
|
||||
#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
|
||||
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL
|
||||
#define FT_SIZEOF_LONG ( 64 / FT_CHAR_BIT )
|
||||
#else
|
||||
#error "Unsupported size of `long' type!"
|
||||
#endif
|
||||
|
||||
|
||||
/* `FT_UNUSED` indicates that a given parameter is not used -- */
|
||||
/* this is only used to get rid of unpleasant compiler warnings. */
|
||||
#ifndef FT_UNUSED
|
||||
#define FT_UNUSED( arg ) ( (arg) = (arg) )
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* AUTOMATIC CONFIGURATION MACROS
|
||||
*
|
||||
* These macros are computed from the ones defined above. Don't touch
|
||||
* their definition, unless you know precisely what you are doing. No
|
||||
* porter should need to mess with them.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Mac support
|
||||
*
|
||||
* This is the only necessary change, so it is defined here instead
|
||||
* providing a new configuration file.
|
||||
*/
|
||||
#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
|
||||
/* No Carbon frameworks for 64bit 10.4.x. */
|
||||
/* `AvailabilityMacros.h` is available since Mac OS X 10.2, */
|
||||
/* so guess the system version by maximum errno before inclusion. */
|
||||
#include <errno.h>
|
||||
#ifdef ECANCELED /* defined since 10.2 */
|
||||
#include "AvailabilityMacros.h"
|
||||
#endif
|
||||
#if defined( __LP64__ ) && \
|
||||
( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
|
||||
#undef FT_MACINTOSH
|
||||
#endif
|
||||
|
||||
#elif defined( __SC__ ) || defined( __MRC__ )
|
||||
/* Classic MacOS compilers */
|
||||
#include "ConditionalMacros.h"
|
||||
#if TARGET_OS_MAC
|
||||
#define FT_MACINTOSH 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Fix compiler warning with sgi compiler. */
|
||||
#if defined( __sgi ) && !defined( __GNUC__ )
|
||||
#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
|
||||
#pragma set woff 3505
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* basic_types
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Int16
|
||||
*
|
||||
* @description:
|
||||
* A typedef for a 16bit signed integer type.
|
||||
*/
|
||||
typedef signed short FT_Int16;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_UInt16
|
||||
*
|
||||
* @description:
|
||||
* A typedef for a 16bit unsigned integer type.
|
||||
*/
|
||||
typedef unsigned short FT_UInt16;
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/* this #if 0 ... #endif clause is for documentation purposes */
|
||||
#if 0
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Int32
|
||||
*
|
||||
* @description:
|
||||
* A typedef for a 32bit signed integer type. The size depends on the
|
||||
* configuration.
|
||||
*/
|
||||
typedef signed XXX FT_Int32;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_UInt32
|
||||
*
|
||||
* A typedef for a 32bit unsigned integer type. The size depends on the
|
||||
* configuration.
|
||||
*/
|
||||
typedef unsigned XXX FT_UInt32;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Int64
|
||||
*
|
||||
* A typedef for a 64bit signed integer type. The size depends on the
|
||||
* configuration. Only defined if there is real 64bit support;
|
||||
* otherwise, it gets emulated with a structure (if necessary).
|
||||
*/
|
||||
typedef signed XXX FT_Int64;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_UInt64
|
||||
*
|
||||
* A typedef for a 64bit unsigned integer type. The size depends on the
|
||||
* configuration. Only defined if there is real 64bit support;
|
||||
* otherwise, it gets emulated with a structure (if necessary).
|
||||
*/
|
||||
typedef unsigned XXX FT_UInt64;
|
||||
|
||||
/* */
|
||||
|
||||
#endif
|
||||
|
||||
#if FT_SIZEOF_INT == ( 32 / FT_CHAR_BIT )
|
||||
|
||||
typedef signed int FT_Int32;
|
||||
typedef unsigned int FT_UInt32;
|
||||
|
||||
#elif FT_SIZEOF_LONG == ( 32 / FT_CHAR_BIT )
|
||||
|
||||
typedef signed long FT_Int32;
|
||||
typedef unsigned long FT_UInt32;
|
||||
|
||||
#else
|
||||
#error "no 32bit type found -- please check your configuration files"
|
||||
#endif
|
||||
|
||||
|
||||
/* look up an integer type that is at least 32~bits */
|
||||
#if FT_SIZEOF_INT >= ( 32 / FT_CHAR_BIT )
|
||||
|
||||
typedef int FT_Fast;
|
||||
typedef unsigned int FT_UFast;
|
||||
|
||||
#elif FT_SIZEOF_LONG >= ( 32 / FT_CHAR_BIT )
|
||||
|
||||
typedef long FT_Fast;
|
||||
typedef unsigned long FT_UFast;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* determine whether we have a 64-bit `int` type for platforms without */
|
||||
/* Autoconf */
|
||||
#if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT )
|
||||
|
||||
/* `FT_LONG64` must be defined if a 64-bit type is available */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long
|
||||
#define FT_UINT64 unsigned long
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* A 64-bit data type may create compilation problems if you compile in
|
||||
* strict ANSI mode. To avoid them, we disable other 64-bit data types if
|
||||
* `__STDC__` is defined. You can however ignore this rule by defining the
|
||||
* `FT_CONFIG_OPTION_FORCE_INT64` configuration macro.
|
||||
*/
|
||||
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
|
||||
|
||||
#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
|
||||
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
|
||||
|
||||
/* this compiler provides the `__int64` type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 __int64
|
||||
#define FT_UINT64 unsigned __int64
|
||||
|
||||
#elif defined( __BORLANDC__ ) /* Borland C++ */
|
||||
|
||||
/* XXXX: We should probably check the value of `__BORLANDC__` in order */
|
||||
/* to test the compiler version. */
|
||||
|
||||
/* this compiler provides the `__int64` type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 __int64
|
||||
#define FT_UINT64 unsigned __int64
|
||||
|
||||
#elif defined( __WATCOMC__ ) /* Watcom C++ */
|
||||
|
||||
/* Watcom doesn't provide 64-bit data types */
|
||||
|
||||
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
|
||||
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
#elif defined( __GNUC__ )
|
||||
|
||||
/* GCC provides the `long long` type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
#endif /* __STDC_VERSION__ >= 199901L */
|
||||
|
||||
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
|
||||
|
||||
#ifdef FT_LONG64
|
||||
typedef FT_INT64 FT_Int64;
|
||||
typedef FT_UINT64 FT_UInt64;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _WIN64
|
||||
/* only 64bit Windows uses the LLP64 data model, i.e., */
|
||||
/* 32bit integers, 64bit pointers */
|
||||
#define FT_UINT_TO_POINTER( x ) (void*)(unsigned __int64)(x)
|
||||
#else
|
||||
#define FT_UINT_TO_POINTER( x ) (void*)(unsigned long)(x)
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* miscellaneous
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#define FT_BEGIN_STMNT do {
|
||||
#define FT_END_STMNT } while ( 0 )
|
||||
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
|
||||
|
||||
|
||||
/* `typeof` condition taken from gnulib's `intprops.h` header file */
|
||||
#if ( ( defined( __GNUC__ ) && __GNUC__ >= 2 ) || \
|
||||
( defined( __IBMC__ ) && __IBMC__ >= 1210 && \
|
||||
defined( __IBM__TYPEOF__ ) ) || \
|
||||
( defined( __SUNPRO_C ) && __SUNPRO_C >= 0x5110 && !__STDC__ ) )
|
||||
#define FT_TYPEOF( type ) ( __typeof__ ( type ) )
|
||||
#else
|
||||
#define FT_TYPEOF( type ) /* empty */
|
||||
#endif
|
||||
|
||||
|
||||
/* Use `FT_LOCAL` and `FT_LOCAL_DEF` to declare and define, */
|
||||
/* respectively, a function that gets used only within the scope of a */
|
||||
/* module. Normally, both the header and source code files for such a */
|
||||
/* function are within a single module directory. */
|
||||
/* */
|
||||
/* Intra-module arrays should be tagged with `FT_LOCAL_ARRAY` and */
|
||||
/* `FT_LOCAL_ARRAY_DEF`. */
|
||||
/* */
|
||||
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
|
||||
|
||||
#define FT_LOCAL( x ) static x
|
||||
#define FT_LOCAL_DEF( x ) static x
|
||||
|
||||
#else
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_LOCAL( x ) extern "C" x
|
||||
#define FT_LOCAL_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_LOCAL( x ) extern x
|
||||
#define FT_LOCAL_DEF( x ) x
|
||||
#endif
|
||||
|
||||
#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
|
||||
|
||||
#define FT_LOCAL_ARRAY( x ) extern const x
|
||||
#define FT_LOCAL_ARRAY_DEF( x ) const x
|
||||
|
||||
|
||||
/* Use `FT_BASE` and `FT_BASE_DEF` to declare and define, respectively, */
|
||||
/* functions that are used in more than a single module. In the */
|
||||
/* current setup this implies that the declaration is in a header file */
|
||||
/* in the `include/freetype/internal` directory, and the function body */
|
||||
/* is in a file in `src/base`. */
|
||||
/* */
|
||||
#ifndef FT_BASE
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_BASE( x ) extern "C" x
|
||||
#else
|
||||
#define FT_BASE( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_BASE */
|
||||
|
||||
|
||||
#ifndef FT_BASE_DEF
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_BASE_DEF( x ) x
|
||||
#else
|
||||
#define FT_BASE_DEF( x ) x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_BASE_DEF */
|
||||
|
||||
|
||||
/* When compiling FreeType as a DLL or DSO with hidden visibility */
|
||||
/* some systems/compilers need a special attribute in front OR after */
|
||||
/* the return type of function declarations. */
|
||||
/* */
|
||||
/* Two macros are used within the FreeType source code to define */
|
||||
/* exported library functions: `FT_EXPORT` and `FT_EXPORT_DEF`. */
|
||||
/* */
|
||||
/* - `FT_EXPORT( return_type )` */
|
||||
/* */
|
||||
/* is used in a function declaration, as in */
|
||||
/* */
|
||||
/* ``` */
|
||||
/* FT_EXPORT( FT_Error ) */
|
||||
/* FT_Init_FreeType( FT_Library* alibrary ); */
|
||||
/* ``` */
|
||||
/* */
|
||||
/* - `FT_EXPORT_DEF( return_type )` */
|
||||
/* */
|
||||
/* is used in a function definition, as in */
|
||||
/* */
|
||||
/* ``` */
|
||||
/* FT_EXPORT_DEF( FT_Error ) */
|
||||
/* FT_Init_FreeType( FT_Library* alibrary ) */
|
||||
/* { */
|
||||
/* ... some code ... */
|
||||
/* return FT_Err_Ok; */
|
||||
/* } */
|
||||
/* ``` */
|
||||
/* */
|
||||
/* You can provide your own implementation of `FT_EXPORT` and */
|
||||
/* `FT_EXPORT_DEF` here if you want. */
|
||||
/* */
|
||||
/* To export a variable, use `FT_EXPORT_VAR`. */
|
||||
/* */
|
||||
#ifndef FT_EXPORT
|
||||
|
||||
#ifdef FT2_BUILD_LIBRARY
|
||||
|
||||
#if defined( _WIN32 ) && defined( DLL_EXPORT )
|
||||
#define FT_EXPORT( x ) __declspec( dllexport ) x
|
||||
#elif defined( __GNUC__ ) && __GNUC__ >= 4
|
||||
#define FT_EXPORT( x ) __attribute__(( visibility( "default" ) )) x
|
||||
#elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x550
|
||||
#define FT_EXPORT( x ) __global x
|
||||
#elif defined( __cplusplus )
|
||||
#define FT_EXPORT( x ) extern "C" x
|
||||
#else
|
||||
#define FT_EXPORT( x ) extern x
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#if defined( _WIN32 ) && defined( DLL_IMPORT )
|
||||
#define FT_EXPORT( x ) __declspec( dllimport ) x
|
||||
#elif defined( __cplusplus )
|
||||
#define FT_EXPORT( x ) extern "C" x
|
||||
#else
|
||||
#define FT_EXPORT( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* !FT_EXPORT */
|
||||
|
||||
|
||||
#ifndef FT_EXPORT_DEF
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_EXPORT_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_EXPORT_DEF( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_EXPORT_DEF */
|
||||
|
||||
|
||||
#ifndef FT_EXPORT_VAR
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_EXPORT_VAR( x ) extern "C" x
|
||||
#else
|
||||
#define FT_EXPORT_VAR( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_EXPORT_VAR */
|
||||
|
||||
|
||||
/* The following macros are needed to compile the library with a */
|
||||
/* C++ compiler and with 16bit compilers. */
|
||||
/* */
|
||||
|
||||
/* This is special. Within C++, you must specify `extern "C"` for */
|
||||
/* functions which are used via function pointers, and you also */
|
||||
/* must do that for structures which contain function pointers to */
|
||||
/* assure C linkage -- it's not possible to have (local) anonymous */
|
||||
/* functions which are accessed by (global) function pointers. */
|
||||
/* */
|
||||
/* */
|
||||
/* FT_CALLBACK_DEF is used to _define_ a callback function, */
|
||||
/* located in the same source code file as the structure that uses */
|
||||
/* it. */
|
||||
/* */
|
||||
/* FT_BASE_CALLBACK and FT_BASE_CALLBACK_DEF are used to declare */
|
||||
/* and define a callback function, respectively, in a similar way */
|
||||
/* as FT_BASE and FT_BASE_DEF work. */
|
||||
/* */
|
||||
/* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
|
||||
/* contains pointers to callback functions. */
|
||||
/* */
|
||||
/* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
|
||||
/* that contains pointers to callback functions. */
|
||||
/* */
|
||||
/* */
|
||||
/* Some 16bit compilers have to redefine these macros to insert */
|
||||
/* the infamous `_cdecl` or `__fastcall` declarations. */
|
||||
/* */
|
||||
#ifndef FT_CALLBACK_DEF
|
||||
#ifdef __cplusplus
|
||||
#define FT_CALLBACK_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_CALLBACK_DEF( x ) static x
|
||||
#endif
|
||||
#endif /* FT_CALLBACK_DEF */
|
||||
|
||||
#ifndef FT_BASE_CALLBACK
|
||||
#ifdef __cplusplus
|
||||
#define FT_BASE_CALLBACK( x ) extern "C" x
|
||||
#define FT_BASE_CALLBACK_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_BASE_CALLBACK( x ) extern x
|
||||
#define FT_BASE_CALLBACK_DEF( x ) x
|
||||
#endif
|
||||
#endif /* FT_BASE_CALLBACK */
|
||||
|
||||
#ifndef FT_CALLBACK_TABLE
|
||||
#ifdef __cplusplus
|
||||
#define FT_CALLBACK_TABLE extern "C"
|
||||
#define FT_CALLBACK_TABLE_DEF extern "C"
|
||||
#else
|
||||
#define FT_CALLBACK_TABLE extern
|
||||
#define FT_CALLBACK_TABLE_DEF /* nothing */
|
||||
#endif
|
||||
#endif /* FT_CALLBACK_TABLE */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#include <freetype/config/integer-types.h>
|
||||
#include <freetype/config/public-macros.h>
|
||||
#include <freetype/config/mac-support.h>
|
||||
|
||||
#endif /* FTCONFIG_H_ */
|
||||
|
||||
|
|
|
@ -30,10 +30,12 @@
|
|||
/* encapsulated in an `extern "C" { .. }` block when included from a */
|
||||
/* C++ compiler. */
|
||||
/* */
|
||||
#ifdef __cplusplus
|
||||
#define FT_BEGIN_HEADER extern "C" {
|
||||
#else
|
||||
#define FT_BEGIN_HEADER /* nothing */
|
||||
#ifndef FT_BEGIN_HEADER
|
||||
# ifdef __cplusplus
|
||||
# define FT_BEGIN_HEADER extern "C" {
|
||||
# else
|
||||
# define FT_BEGIN_HEADER /* nothing */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -48,10 +50,12 @@
|
|||
/* encapsulated in an `extern "C" { .. }` block when included from a */
|
||||
/* C++ compiler. */
|
||||
/* */
|
||||
#ifdef __cplusplus
|
||||
#define FT_END_HEADER }
|
||||
#else
|
||||
#define FT_END_HEADER /* nothing */
|
||||
#ifndef FT_END_HEADER
|
||||
# ifdef __cplusplus
|
||||
# define FT_END_HEADER }
|
||||
# else
|
||||
# define FT_END_HEADER /* nothing */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -431,6 +431,21 @@ FT_BEGIN_HEADER
|
|||
/* #define FT_DEBUG_LEVEL_TRACE */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* Logging
|
||||
*
|
||||
* Compiling FreeType in debug or trace mode will make FreeType to write
|
||||
* error and trace log messages to `stderr`.
|
||||
* Enabling this macro will automatically force the `FT_DEBUG_LEVEL_ERROR`
|
||||
* and `FT_DEBUG_LEVEL_TRACE` macros and will allow FreeType to write
|
||||
* error and trace log messages to a file instead of `stderr`
|
||||
* For writing logs to file FreeType uses an external library `dlg`
|
||||
* Source Code - `src/dlg`
|
||||
*
|
||||
*/
|
||||
/* #define FT_LOGGING */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Autofitter debugging
|
||||
|
|
|
@ -0,0 +1,245 @@
|
|||
/****************************************************************************
|
||||
*
|
||||
* config/integer-types.h
|
||||
*
|
||||
* FreeType integer types definitions.
|
||||
*
|
||||
* Copyright (C) 1996-2020 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
#ifndef FREETYPE_CONFIG_INTEGER_TYPES_H_
|
||||
#define FREETYPE_CONFIG_INTEGER_TYPES_H_
|
||||
|
||||
/* There are systems (like the Texas Instruments 'C54x) where a `char` */
|
||||
/* has 16~bits. ANSI~C says that `sizeof(char)` is always~1. Since an */
|
||||
/* `int` has 16~bits also for this system, `sizeof(int)` gives~1 which */
|
||||
/* is probably unexpected. */
|
||||
/* */
|
||||
/* `CHAR_BIT` (defined in `limits.h`) gives the number of bits in a */
|
||||
/* `char` type. */
|
||||
|
||||
#ifndef FT_CHAR_BIT
|
||||
#define FT_CHAR_BIT CHAR_BIT
|
||||
#endif
|
||||
|
||||
#ifndef FT_SIZEOF_INT
|
||||
|
||||
/* The size of an `int` type. */
|
||||
#if FT_UINT_MAX == 0xFFFFUL
|
||||
#define FT_SIZEOF_INT ( 16 / FT_CHAR_BIT )
|
||||
#elif FT_UINT_MAX == 0xFFFFFFFFUL
|
||||
#define FT_SIZEOF_INT ( 32 / FT_CHAR_BIT )
|
||||
#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL
|
||||
#define FT_SIZEOF_INT ( 64 / FT_CHAR_BIT )
|
||||
#else
|
||||
#error "Unsupported size of `int' type!"
|
||||
#endif
|
||||
|
||||
#endif /* !defined(FT_SIZEOF_INT) */
|
||||
|
||||
#ifndef FT_SIZEOF_LONG
|
||||
|
||||
/* The size of a `long` type. A five-byte `long` (as used e.g. on the */
|
||||
/* DM642) is recognized but avoided. */
|
||||
#if FT_ULONG_MAX == 0xFFFFFFFFUL
|
||||
#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
|
||||
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
|
||||
#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
|
||||
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL
|
||||
#define FT_SIZEOF_LONG ( 64 / FT_CHAR_BIT )
|
||||
#else
|
||||
#error "Unsupported size of `long' type!"
|
||||
#endif
|
||||
|
||||
#endif /* !defined(FT_SIZEOF_LONG) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* basic_types
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Int16
|
||||
*
|
||||
* @description:
|
||||
* A typedef for a 16bit signed integer type.
|
||||
*/
|
||||
typedef signed short FT_Int16;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_UInt16
|
||||
*
|
||||
* @description:
|
||||
* A typedef for a 16bit unsigned integer type.
|
||||
*/
|
||||
typedef unsigned short FT_UInt16;
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/* this #if 0 ... #endif clause is for documentation purposes */
|
||||
#if 0
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Int32
|
||||
*
|
||||
* @description:
|
||||
* A typedef for a 32bit signed integer type. The size depends on the
|
||||
* configuration.
|
||||
*/
|
||||
typedef signed XXX FT_Int32;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_UInt32
|
||||
*
|
||||
* A typedef for a 32bit unsigned integer type. The size depends on the
|
||||
* configuration.
|
||||
*/
|
||||
typedef unsigned XXX FT_UInt32;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Int64
|
||||
*
|
||||
* A typedef for a 64bit signed integer type. The size depends on the
|
||||
* configuration. Only defined if there is real 64bit support;
|
||||
* otherwise, it gets emulated with a structure (if necessary).
|
||||
*/
|
||||
typedef signed XXX FT_Int64;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_UInt64
|
||||
*
|
||||
* A typedef for a 64bit unsigned integer type. The size depends on the
|
||||
* configuration. Only defined if there is real 64bit support;
|
||||
* otherwise, it gets emulated with a structure (if necessary).
|
||||
*/
|
||||
typedef unsigned XXX FT_UInt64;
|
||||
|
||||
/* */
|
||||
|
||||
#endif
|
||||
|
||||
#if FT_SIZEOF_INT == ( 32 / FT_CHAR_BIT )
|
||||
|
||||
typedef signed int FT_Int32;
|
||||
typedef unsigned int FT_UInt32;
|
||||
|
||||
#elif FT_SIZEOF_LONG == ( 32 / FT_CHAR_BIT )
|
||||
|
||||
typedef signed long FT_Int32;
|
||||
typedef unsigned long FT_UInt32;
|
||||
|
||||
#else
|
||||
#error "no 32bit type found -- please check your configuration files"
|
||||
#endif
|
||||
|
||||
|
||||
/* look up an integer type that is at least 32~bits */
|
||||
#if FT_SIZEOF_INT >= ( 32 / FT_CHAR_BIT )
|
||||
|
||||
typedef int FT_Fast;
|
||||
typedef unsigned int FT_UFast;
|
||||
|
||||
#elif FT_SIZEOF_LONG >= ( 32 / FT_CHAR_BIT )
|
||||
|
||||
typedef long FT_Fast;
|
||||
typedef unsigned long FT_UFast;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* determine whether we have a 64-bit `int` type for platforms without */
|
||||
/* Autoconf */
|
||||
#if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT )
|
||||
|
||||
/* `FT_LONG64` must be defined if a 64-bit type is available */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long
|
||||
#define FT_UINT64 unsigned long
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* A 64-bit data type may create compilation problems if you compile in
|
||||
* strict ANSI mode. To avoid them, we disable other 64-bit data types if
|
||||
* `__STDC__` is defined. You can however ignore this rule by defining the
|
||||
* `FT_CONFIG_OPTION_FORCE_INT64` configuration macro.
|
||||
*/
|
||||
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
|
||||
|
||||
#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
|
||||
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
|
||||
|
||||
/* this compiler provides the `__int64` type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 __int64
|
||||
#define FT_UINT64 unsigned __int64
|
||||
|
||||
#elif defined( __BORLANDC__ ) /* Borland C++ */
|
||||
|
||||
/* XXXX: We should probably check the value of `__BORLANDC__` in order */
|
||||
/* to test the compiler version. */
|
||||
|
||||
/* this compiler provides the `__int64` type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 __int64
|
||||
#define FT_UINT64 unsigned __int64
|
||||
|
||||
#elif defined( __WATCOMC__ ) /* Watcom C++ */
|
||||
|
||||
/* Watcom doesn't provide 64-bit data types */
|
||||
|
||||
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
|
||||
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
#elif defined( __GNUC__ )
|
||||
|
||||
/* GCC provides the `long long` type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
#define FT_UINT64 unsigned long long int
|
||||
|
||||
#endif /* __STDC_VERSION__ >= 199901L */
|
||||
|
||||
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
|
||||
|
||||
#ifdef FT_LONG64
|
||||
typedef FT_INT64 FT_Int64;
|
||||
typedef FT_UINT64 FT_UInt64;
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* FREETYPE_CONFIG_INTEGER_TYPES_H_ */
|
|
@ -0,0 +1,49 @@
|
|||
/****************************************************************************
|
||||
*
|
||||
* config/mac-support.h
|
||||
*
|
||||
* Mac/OS X support configuration header.
|
||||
*
|
||||
* Copyright (C) 1996-2020 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
#ifndef FREETYPE_CONFIG_MAC_SUPPORT_H_
|
||||
#define FREETYPE_CONFIG_MAC_SUPPORT_H_
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Mac support
|
||||
*
|
||||
* This is the only necessary change, so it is defined here instead
|
||||
* providing a new configuration file.
|
||||
*/
|
||||
#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
|
||||
/* No Carbon frameworks for 64bit 10.4.x. */
|
||||
/* `AvailabilityMacros.h` is available since Mac OS X 10.2, */
|
||||
/* so guess the system version by maximum errno before inclusion. */
|
||||
#include <errno.h>
|
||||
#ifdef ECANCELED /* defined since 10.2 */
|
||||
#include "AvailabilityMacros.h"
|
||||
#endif
|
||||
#if defined( __LP64__ ) && \
|
||||
( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
|
||||
#undef FT_MACINTOSH
|
||||
#endif
|
||||
|
||||
#elif defined( __SC__ ) || defined( __MRC__ )
|
||||
/* Classic MacOS compilers */
|
||||
#include "ConditionalMacros.h"
|
||||
#if TARGET_OS_MAC
|
||||
#define FT_MACINTOSH 1
|
||||
#endif
|
||||
|
||||
#endif /* Mac support */
|
||||
|
||||
#endif /* FREETYPE_CONFIG_MAC_SUPPORT_H_ */
|
|
@ -0,0 +1,100 @@
|
|||
/****************************************************************************
|
||||
*
|
||||
* config/public-macros.h
|
||||
*
|
||||
* Define a set of compiler macros used in public FreeType headers.
|
||||
*
|
||||
* Copyright (C) 2020 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
/* The definitions in this file are used by the public FreeType headers,
|
||||
* and thus should be considered part of the public API.
|
||||
*
|
||||
* Other compiler-specific macro definitions that are not exposed by the
|
||||
* FreeType API should go into include/freetype/internal/compiler-macros.h
|
||||
* instead.
|
||||
*/
|
||||
#ifndef FREETYPE_CONFIG_PUBLIC_MACROS_H_
|
||||
#define FREETYPE_CONFIG_PUBLIC_MACROS_H_
|
||||
|
||||
/* FT_BEGIN_HEADER and FT_END_HEADER might have already been defined by
|
||||
* <freetype/config/ftheader.h>, but we don't want to include this header
|
||||
* here, so redefine the macros here only when needed. Their definition is
|
||||
* very stable, so keeping them in sync with the ones in the header should
|
||||
* not be a maintenance issue.
|
||||
*/
|
||||
#ifndef FT_BEGIN_HEADER
|
||||
# ifdef __cplusplus
|
||||
# define FT_BEGIN_HEADER extern "C" {
|
||||
# else
|
||||
# define FT_BEGIN_HEADER /* nothing */
|
||||
# endif
|
||||
#endif /* FT_END_HEADER */
|
||||
|
||||
#ifndef FT_END_HEADER
|
||||
# ifdef __cplusplus
|
||||
# define FT_END_HEADER }
|
||||
# else
|
||||
# define FT_END_HEADER /* nothing */
|
||||
# endif
|
||||
#endif /* FT_END_HEADER */
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/* Mark a function declaration as public. This ensures it will be properly
|
||||
* exported to client code. Place this before a function declaration.
|
||||
*
|
||||
* NOTE: This macro should be considered an internal implementation detail, and
|
||||
* not part of the FreeType API. It is only defined here because it is needed
|
||||
* by FT_EXPORT()
|
||||
*/
|
||||
#if defined(_WIN32)
|
||||
# if defined(FT2_BUILD_LIBRARY) && defined( DLL_EXPORT )
|
||||
# define FT_PUBLIC_FUNCTION_ATTRIBUTE __declspec( dllexport )
|
||||
# elif defined( DLL_IMPORT )
|
||||
# define FT_PUBLIC_FUNCTION_ATTRIBUTE __declspec( dllimport )
|
||||
# endif
|
||||
#elif (defined(__GNUC__) && __GNUC__ >= 4) || defined(__clang__)
|
||||
# define FT_PUBLIC_FUNCTION_ATTRIBUTE __attribute__((visibility("default")))
|
||||
#elif defined(__SUNPRO_C) && __SUNPRO_C >= 0x550
|
||||
# define FT_PUBLIC_FUNCTION_ATTRIBUTE __global
|
||||
#endif
|
||||
|
||||
#ifndef FT_PUBLIC_FUNCTION_ATTRIBUTE
|
||||
# define FT_PUBLIC_FUNCTION_ATTRIBUTE /* nothing */
|
||||
#endif
|
||||
|
||||
/* Define a public FreeType API function. This ensures it is properly exported
|
||||
* or imported at build time. The macro parameter is the function's return type
|
||||
* as in:
|
||||
*
|
||||
* FT_EXPORT( FT_Bool ) FT_Object_Method( FT_Object obj, ... );
|
||||
*
|
||||
* NOTE: This requires that all FT_EXPORT() uses are inside FT_BEGIN_HEADER ..
|
||||
* FT_END_HEADER blocks. This guarantees that the functions are exported with
|
||||
* C linkage, even when the header is included by a C++ source file.
|
||||
*/
|
||||
#define FT_EXPORT( x ) FT_PUBLIC_FUNCTION_ATTRIBUTE extern x
|
||||
|
||||
/* `FT_UNUSED` indicates that a given parameter is not used -- */
|
||||
/* this is only used to get rid of unpleasant compiler warnings. */
|
||||
/* */
|
||||
/* Technically, this was not meant to be part of the public API, */
|
||||
/* but some third-party code depends on it. */
|
||||
/* */
|
||||
#ifndef FT_UNUSED
|
||||
#define FT_UNUSED( arg ) ( (arg) = (arg) )
|
||||
#endif
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FREETYPE_CONFIG_PUBLIC_MACROS_H_ */
|
|
@ -958,6 +958,9 @@ FT_BEGIN_HEADER
|
|||
* Note that the bounding box might be off by (at least) one pixel for
|
||||
* hinted fonts. See @FT_Size_Metrics for further discussion.
|
||||
*
|
||||
* Note that the bounding box does not vary in OpenType variable fonts
|
||||
* and should only be used in relation to the default instance.
|
||||
*
|
||||
* units_per_EM ::
|
||||
* The number of font units per EM square for this face. This is
|
||||
* typically 2048 for TrueType fonts, and 1000 for Type~1 fonts. Only
|
||||
|
@ -3172,6 +3175,12 @@ FT_BEGIN_HEADER
|
|||
* A pointer to the translation vector. Use `NULL` for the null vector.
|
||||
*
|
||||
* @note:
|
||||
* This function is provided as a convenience, but keep in mind that
|
||||
* @FT_Matrix coefficients are only 16.16 fixed point values, which can
|
||||
* limit the accuracy of the results. Using floating-point computations
|
||||
* to perform the transform directly in client code instead will always
|
||||
* yield better numbers.
|
||||
*
|
||||
* The transformation is only applied to scalable image formats after the
|
||||
* glyph has been loaded. It means that hinting is unaltered by the
|
||||
* transformation and is performed on the character size given in the
|
||||
|
|
|
@ -123,6 +123,7 @@
|
|||
* gzip
|
||||
* lzw
|
||||
* bzip2
|
||||
* debugging_apis
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -426,10 +426,6 @@ FT_BEGIN_HEADER
|
|||
* counteracts the 'thinning out' of glyphs, making text remain readable
|
||||
* at smaller sizes.
|
||||
*
|
||||
* By default, the Adobe engines for CFF, Type~1, and CID fonts darken
|
||||
* stems at smaller sizes, regardless of hinting, to enhance contrast.
|
||||
* Setting this property, stem darkening gets switched off.
|
||||
*
|
||||
* For the auto-hinter, stem-darkening is experimental currently and thus
|
||||
* switched off by default (this is, `no-stem-darkening` is set to TRUE
|
||||
* by default). Total consistency with the CFF driver is not achieved
|
||||
|
|
|
@ -400,6 +400,13 @@ FT_BEGIN_HEADER
|
|||
* if @FT_OUTLINE_IGNORE_DROPOUTS is set. See below for more
|
||||
* information.
|
||||
*
|
||||
* FT_OUTLINE_OVERLAP ::
|
||||
* This flag indicates that this outline contains overlapping contrours
|
||||
* and the anti-aliased renderer should perform oversampling to
|
||||
* metigate possible artifacts. This flag should _not_ be set for
|
||||
* well designed glyphs without overlaps because it quadruples the
|
||||
* rendering time.
|
||||
*
|
||||
* FT_OUTLINE_HIGH_PRECISION ::
|
||||
* This flag indicates that the scan-line converter should try to
|
||||
* convert this outline to bitmaps with the highest possible quality.
|
||||
|
@ -432,6 +439,7 @@ FT_BEGIN_HEADER
|
|||
#define FT_OUTLINE_SMART_DROPOUTS 0x10
|
||||
#define FT_OUTLINE_INCLUDE_STUBS 0x20
|
||||
|
||||
#define FT_OUTLINE_OVERLAP 0x80
|
||||
#define FT_OUTLINE_HIGH_PRECISION 0x100
|
||||
#define FT_OUTLINE_SINGLE_PASS 0x200
|
||||
|
||||
|
|
|
@ -0,0 +1,149 @@
|
|||
/****************************************************************************
|
||||
*
|
||||
* ftlogging.h
|
||||
*
|
||||
* Additional debugging APIs.
|
||||
*
|
||||
* Copyright (C) 2008-2020 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTLOGGING_H_
|
||||
#define FTLOGGING_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_CONFIG_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* debugging_apis
|
||||
*
|
||||
* @title:
|
||||
* External Debugginng APIs
|
||||
*
|
||||
* @abstract:
|
||||
* Pubic APIs to use while debugging using `FT_LOGGING' macro
|
||||
*
|
||||
* @description:
|
||||
* This section contains the declaration the public APIs which can be
|
||||
* used to debug an application using `FT_LOGGING'.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Trace_Set_Level
|
||||
*
|
||||
* @description:
|
||||
* To change the levels of tracing components at run time.
|
||||
*
|
||||
* @input:
|
||||
*
|
||||
* tracing_level ::
|
||||
* New levels of of tracing components.
|
||||
*
|
||||
* @example:
|
||||
* This function can be used to change the tracing levels of FreeType's
|
||||
* component as follows:
|
||||
*
|
||||
* ```
|
||||
* new_levels = "any:7 memory:0";
|
||||
* FT_Trace_Set_Level( new_levels );
|
||||
* ```
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Trace_Set_Level( const char* tracing_level );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Trace_Set_Default_Level
|
||||
*
|
||||
* @description:
|
||||
* If previously, `FT_Trace_Set_Level' functions is used to set new
|
||||
* values of the tracing components of FreeType, this function could
|
||||
* be used to reset the level of tracing components to the default
|
||||
* value.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Trace_Set_Default_Level( void );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* FT_Custom_Log_Handler
|
||||
*
|
||||
* @description:
|
||||
* A function used to handle the logging of tracing and debug messages
|
||||
* on a file system.
|
||||
*
|
||||
* @input:
|
||||
* ft_component ::
|
||||
* The name of `FT_COMPONENT' from which the current debug or error
|
||||
* message is produced.
|
||||
*
|
||||
* fmt ::
|
||||
* Actual debug or tracing message.
|
||||
*
|
||||
* args::
|
||||
* Arguments of debug or tracing messages.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*FT_Custom_Log_Handler)( const char* ft_component, const char* fmt,
|
||||
va_list args );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Set_Log_Handler
|
||||
*
|
||||
* @description:
|
||||
* A function to set a custom log handler
|
||||
*
|
||||
* @input:
|
||||
*
|
||||
* handler ::
|
||||
* New logging function
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Set_Log_Handler( FT_Custom_Log_Handler handler );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Set_Default_Log_Handler
|
||||
*
|
||||
* @description:
|
||||
* If previously, `FT_Set_Log_Handler' functions is used to set new
|
||||
* custom logging function, this API could be used to reset the back
|
||||
* the log handler to FreeType's inbuilt log handler.
|
||||
*
|
||||
*/
|
||||
|
||||
FT_EXPORT( void )
|
||||
FT_Set_Default_Log_Handler( void );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTLOGGING_H_ */
|
|
@ -485,7 +485,7 @@ FT_BEGIN_HEADER
|
|||
*
|
||||
* ```
|
||||
* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
|
||||
* cff:no-stem-darkening=1 \
|
||||
* cff:no-stem-darkening=0 \
|
||||
* autofitter:warping=1
|
||||
* ```
|
||||
*
|
||||
|
|
|
@ -207,6 +207,9 @@ FT_BEGIN_HEADER
|
|||
} FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface;
|
||||
|
||||
|
||||
#define FT_DECLARE_AUTOHINTER_INTERFACE( class_ ) \
|
||||
FT_CALLBACK_TABLE const FT_AutoHinter_InterfaceRec class_;
|
||||
|
||||
#define FT_DEFINE_AUTOHINTER_INTERFACE( \
|
||||
class_, \
|
||||
reset_face_, \
|
||||
|
|
|
@ -0,0 +1,267 @@
|
|||
/****************************************************************************
|
||||
*
|
||||
* internal/compiler-macros.h
|
||||
*
|
||||
* Compiler-specific macro definitions used internally by FreeType.
|
||||
*
|
||||
* Copyright (C) 2020 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef INTERNAL_COMPILER_MACROS_H_
|
||||
#define INTERNAL_COMPILER_MACROS_H_
|
||||
|
||||
#include <freetype/config/public-macros.h>
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/* Fix compiler warning with sgi compiler. */
|
||||
#if defined( __sgi ) && !defined( __GNUC__ )
|
||||
# if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
|
||||
# pragma set woff 3505
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Fix compiler warning with sgi compiler. */
|
||||
#if defined( __sgi ) && !defined( __GNUC__ )
|
||||
# if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
|
||||
# pragma set woff 3505
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* When defining a macro that expands to a non-trivial C statement, use
|
||||
* FT_BEGIN_STMNT and FT_END_STMNT to enclose the macro's body. This ensures
|
||||
* there are no surprises when the macro is invoked in conditional branches.
|
||||
*
|
||||
* E.g.:
|
||||
* #define LOG(...) \
|
||||
* FT_BEGIN_STMNT \
|
||||
* if (logging_enabled) \
|
||||
* log(__VA_ARGS__); \
|
||||
* FT_END_STMNT
|
||||
*/
|
||||
#define FT_BEGIN_STMNT do {
|
||||
#define FT_END_STMNT } while ( 0 )
|
||||
|
||||
/* FT_DUMMY_STMNT expands to an empty C statement. Useful for conditionally
|
||||
* define statement macros, as in:
|
||||
*
|
||||
* #ifdef BUILD_CONFIG_LOGGING
|
||||
* # define LOG(...) \
|
||||
* FT_BEGIN_STMNT \
|
||||
* if (logging_enabled) \
|
||||
* log(__VA_ARGS__); \
|
||||
* FT_END_STMNT
|
||||
* #else
|
||||
* # define LOG(...) FT_DUMMY_STMNT
|
||||
* #endif
|
||||
*/
|
||||
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
|
||||
|
||||
#ifdef _WIN64
|
||||
/* only 64bit Windows uses the LLP64 data model, i.e., */
|
||||
/* 32-bit integers, 64-bit pointers. */
|
||||
#define FT_UINT_TO_POINTER( x ) (void*)(unsigned __int64)(x)
|
||||
#else
|
||||
#define FT_UINT_TO_POINTER( x ) (void*)(unsigned long)(x)
|
||||
#endif
|
||||
|
||||
/* Use FT_TYPEOF(type) to cast a value to |type|. This is useful to suppress
|
||||
* signedness compilation warnings in macros as in:
|
||||
*
|
||||
* #define PAD_(x, n) ( (x) & ~FT_TYPEOF( x )( (n) - 1 ) )
|
||||
*
|
||||
* `typeof` condition taken from gnulib's `intprops.h` header file
|
||||
*/
|
||||
#if ( ( defined( __GNUC__ ) && __GNUC__ >= 2 ) || \
|
||||
( defined( __IBMC__ ) && __IBMC__ >= 1210 && \
|
||||
defined( __IBM__TYPEOF__ ) ) || \
|
||||
( defined( __SUNPRO_C ) && __SUNPRO_C >= 0x5110 && !__STDC__ ) )
|
||||
#define FT_TYPEOF( type ) ( __typeof__ ( type ) )
|
||||
#else
|
||||
#define FT_TYPEOF( type ) /* empty */
|
||||
#endif
|
||||
|
||||
/* Mark a function declaration as internal to the library. This ensures that
|
||||
* it will not be exposed by default to client code, and helps generate smaller
|
||||
* and faster code on ELF-based platforms. Place this before a function
|
||||
* declaration.
|
||||
*/
|
||||
#if (defined(__GNUC__) && __GNUC__ >= 4) || defined(__clang__)
|
||||
#define FT_INTERNAL_FUNCTION_ATTRIBUTE __attribute__((visibility("hidden")))
|
||||
#else
|
||||
#define FT_INTERNAL_FUNCTION_ATTRIBUTE /* nothing */
|
||||
#endif
|
||||
|
||||
/* FreeType supports compiling its C sources to be compiled as C++ instead,
|
||||
* this introduces a number of subtle issues.
|
||||
*
|
||||
* The main one is that a C++ function declaration and its definition must have
|
||||
* the same 'linkage'. Because all FreeType headers declare their function with
|
||||
* C linkage (i.e. within an extern "C" { .. } block, due to the magic of
|
||||
* FT_BEGIN_HEADER and FT_END_HEADER), then their definition in FreeType
|
||||
* sources should also be prefixed with 'extern "C"' when compiled in C++ mode.
|
||||
*
|
||||
* The FT_FUNCTION_DECLARATION() and FT_FUNCTION_DEFINITION() macros are
|
||||
* provided to deal with this case, as well as FT_CALLBACK_DEF et al below.
|
||||
*/
|
||||
|
||||
/* FT_FUNCTION_DECLARATION(type) can be used to write a C function declaration,
|
||||
* and ensure it will have C linkage when the library is built with a C++
|
||||
* compiler. The parameter is the function's return type, so a declaration
|
||||
* would look like:
|
||||
*
|
||||
* FT_FUNCTION_DECLARATION(int) foo(int x);
|
||||
*
|
||||
* NOTE: This requires that all uses are inside FT_BEGIN_HEADER..FT_END_HEADER
|
||||
* blocks. Which guarantees that the declarations have C linkage when the
|
||||
* headers are included by C++ sources.
|
||||
*
|
||||
* NOTE: Do not use directly, use FT_LOCAL()/FT_BASE()/FT_EXPORT() instead.
|
||||
*/
|
||||
#define FT_FUNCTION_DECLARATION( x ) extern x
|
||||
|
||||
/* Same as FT_FUNCTION_DECLARATION(), but for function definitions instead.
|
||||
* NOTE: Do not use directly, use FT_LOCAL_DEF()/FT_BASE_DEF()/FT_EXPORT_DEF()
|
||||
* instead.
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
#define FT_FUNCTION_DEFINITION( x ) extern "C" x
|
||||
#else
|
||||
#define FT_FUNCTION_DEFINITION( x ) x
|
||||
#endif
|
||||
|
||||
/* Use FT_LOCAL()/FT_LOCAL_DEF() to declare and define an internal FreeType
|
||||
* function that is only used by the sources of a single src/module/ directory.
|
||||
* This ensures the functions are turned into static ones at build time,
|
||||
* resulting in smaller and faster code.
|
||||
*/
|
||||
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
|
||||
|
||||
# define FT_LOCAL( x ) static x
|
||||
# define FT_LOCAL_DEF( x ) static x
|
||||
|
||||
#else
|
||||
|
||||
#define FT_LOCAL( x ) FT_INTERNAL_FUNCTION_ATTRIBUTE FT_FUNCTION_DECLARATION( x )
|
||||
#define FT_LOCAL_DEF( x ) FT_FUNCTION_DEFINITION( x )
|
||||
|
||||
#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
|
||||
|
||||
/* Use FT_LOCAL_ARRAY()/FT_LOCAL_ARRAY_DEF() to declare and define a constant
|
||||
* array that must be accessed from several sources in the same src/module/
|
||||
* sub-directory, but are otherwise internal to the library.
|
||||
*/
|
||||
#define FT_LOCAL_ARRAY( x ) FT_INTERNAL_FUNCTION_ATTRIBUTE extern const x
|
||||
#define FT_LOCAL_ARRAY_DEF( x ) FT_FUNCTION_DEFINITION( const x )
|
||||
|
||||
/* Use FT_BASE()/FT_BASE_DEF() to declare or define an internal library
|
||||
* function that are used by more than one single module.
|
||||
*/
|
||||
#define FT_BASE( x ) FT_INTERNAL_FUNCTION_ATTRIBUTE FT_FUNCTION_DECLARATION( x )
|
||||
#define FT_BASE_DEF( x ) FT_FUNCTION_DEFINITION( x )
|
||||
|
||||
|
||||
/* NOTE: Conditionally define FT_EXPORT_VAR() due to its definition in
|
||||
* src/smooth/ftgrays.h to make the header more portable.
|
||||
*/
|
||||
#ifndef FT_EXPORT_VAR
|
||||
#define FT_EXPORT_VAR( x ) FT_FUNCTION_DECLARATION( x )
|
||||
#endif
|
||||
|
||||
/* When compiling FreeType as a DLL or DSO with hidden visibility */
|
||||
/* some systems/compilers need a special attribute in front OR after */
|
||||
/* the return type of function declarations. */
|
||||
/* */
|
||||
/* Two macros are used within the FreeType source code to define */
|
||||
/* exported library functions: `FT_EXPORT` and `FT_EXPORT_DEF`. */
|
||||
/* */
|
||||
/* - `FT_EXPORT( return_type )` */
|
||||
/* */
|
||||
/* is used in a function declaration, as in */
|
||||
/* */
|
||||
/* ``` */
|
||||
/* FT_EXPORT( FT_Error ) */
|
||||
/* FT_Init_FreeType( FT_Library* alibrary ); */
|
||||
/* ``` */
|
||||
/* */
|
||||
/* - `FT_EXPORT_DEF( return_type )` */
|
||||
/* */
|
||||
/* is used in a function definition, as in */
|
||||
/* */
|
||||
/* ``` */
|
||||
/* FT_EXPORT_DEF( FT_Error ) */
|
||||
/* FT_Init_FreeType( FT_Library* alibrary ) */
|
||||
/* { */
|
||||
/* ... some code ... */
|
||||
/* return FT_Err_Ok; */
|
||||
/* } */
|
||||
/* ``` */
|
||||
/* */
|
||||
/* You can provide your own implementation of `FT_EXPORT` and */
|
||||
/* `FT_EXPORT_DEF` here if you want. */
|
||||
/* */
|
||||
/* To export a variable, use `FT_EXPORT_VAR`. */
|
||||
/* */
|
||||
|
||||
/* See <freetype/config/compiler_macros.h> for the FT_EXPORT() definition */
|
||||
#define FT_EXPORT_DEF( x ) FT_FUNCTION_DEFINITION( x )
|
||||
|
||||
/* The following macros are needed to compile the library with a */
|
||||
/* C++ compiler and with 16bit compilers. */
|
||||
/* */
|
||||
|
||||
/* This is special. Within C++, you must specify `extern "C"` for */
|
||||
/* functions which are used via function pointers, and you also */
|
||||
/* must do that for structures which contain function pointers to */
|
||||
/* assure C linkage -- it's not possible to have (local) anonymous */
|
||||
/* functions which are accessed by (global) function pointers. */
|
||||
/* */
|
||||
/* */
|
||||
/* FT_CALLBACK_DEF is used to _define_ a callback function, */
|
||||
/* located in the same source code file as the structure that uses */
|
||||
/* it. */
|
||||
/* */
|
||||
/* FT_BASE_CALLBACK and FT_BASE_CALLBACK_DEF are used to declare */
|
||||
/* and define a callback function, respectively, in a similar way */
|
||||
/* as FT_BASE and FT_BASE_DEF work. */
|
||||
/* */
|
||||
/* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
|
||||
/* contains pointers to callback functions. */
|
||||
/* */
|
||||
/* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
|
||||
/* that contains pointers to callback functions. */
|
||||
/* */
|
||||
/* */
|
||||
/* Some 16bit compilers have to redefine these macros to insert */
|
||||
/* the infamous `_cdecl` or `__fastcall` declarations. */
|
||||
/* */
|
||||
#ifdef __cplusplus
|
||||
#define FT_CALLBACK_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_CALLBACK_DEF( x ) static x
|
||||
#endif
|
||||
|
||||
#define FT_BASE_CALLBACK( x ) FT_FUNCTION_DECLARATION( x )
|
||||
#define FT_BASE_CALLBACK_DEF( x ) FT_FUNCTION_DEFINITION( x )
|
||||
|
||||
#ifndef FT_CALLBACK_TABLE
|
||||
#ifdef __cplusplus
|
||||
#define FT_CALLBACK_TABLE extern "C"
|
||||
#define FT_CALLBACK_TABLE_DEF extern "C"
|
||||
#else
|
||||
#define FT_CALLBACK_TABLE extern
|
||||
#define FT_CALLBACK_TABLE_DEF /* nothing */
|
||||
#endif
|
||||
#endif /* FT_CALLBACK_TABLE */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* INTERNAL_COMPILER_MACROS_H_ */
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
#include "compiler-macros.h"
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
|
|
@ -29,10 +29,34 @@
|
|||
#include FT_CONFIG_CONFIG_H
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
#include "compiler-macros.h"
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Additional include files for supporting logging in FreeType using
|
||||
* external logging library ~ src/dlg and freetype/ftlogging.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_LOGGING
|
||||
#include <../src/dlg/dlg/dlg.h>
|
||||
#include <../src/dlg/dlg/output.h>
|
||||
#include <freetype/ftlogging.h>
|
||||
#endif /* FT_LOGGING */
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/* force the definition of FT_DEBUG_LEVEL_TRACE if FT_LOGGING is already*/
|
||||
/* defined; therefore the following macros */
|
||||
/* */
|
||||
#ifdef FT_LOGGING
|
||||
#undef FT_DEBUG_LEVEL_TRACE
|
||||
#define FT_DEBUG_LEVEL_TRACE
|
||||
#endif /* FT_LOGGING */
|
||||
|
||||
|
||||
/* force the definition of FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE */
|
||||
/* is already defined; this simplifies the following #ifdefs */
|
||||
/* */
|
||||
|
@ -74,26 +98,71 @@ FT_BEGIN_HEADER
|
|||
/**************************************************************************
|
||||
*
|
||||
* Define the FT_TRACE macro
|
||||
*
|
||||
*
|
||||
* IMPORTANT!
|
||||
*
|
||||
* Each component must define the macro FT_COMPONENT to a valid FT_Trace
|
||||
* value before using any TRACE macro.
|
||||
*
|
||||
*
|
||||
* If FT_LOGGING is enabled, trace messages will be sent to dlg's API and
|
||||
* if is FT_LOGGING is disabled trace messages will be sent to
|
||||
* FT_Message(defined in ftdebug.c)
|
||||
* Therefore the following macros:
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_LOGGING
|
||||
|
||||
|
||||
#define FT_LOGGING_TAG( x ) FT_LOGGING_TAG_( x )
|
||||
#define FT_LOGGING_TAG_( x ) #x
|
||||
|
||||
#define FT_LOG( level, varformat ) \
|
||||
do \
|
||||
{ \
|
||||
const char* dlg_tag = FT_LOGGING_TAG( FT_COMPONENT ); \
|
||||
ft_add_tag( dlg_tag ); \
|
||||
if( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] >= level ) \
|
||||
{ \
|
||||
if( custom_output_handler != NULL ) \
|
||||
FT_Callback varformat; \
|
||||
else \
|
||||
dlg_trace varformat; \
|
||||
} \
|
||||
ft_remove_tag( dlg_tag ); \
|
||||
}while( 0 )
|
||||
|
||||
#else
|
||||
|
||||
#define FT_LOG( level, varformat ) \
|
||||
do \
|
||||
{ \
|
||||
if ( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] >= level ) \
|
||||
{ \
|
||||
FT_Message varformat; \
|
||||
} \
|
||||
} while ( 0 )
|
||||
|
||||
#endif /* FT_LOGGING */
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
|
||||
/*function to add dlg tag*/
|
||||
FT_BASE( void )
|
||||
ft_add_tag( const char* tag );
|
||||
|
||||
FT_BASE( void )
|
||||
ft_remove_tag( const char* tag );
|
||||
|
||||
|
||||
/* we need two macros here to make cpp expand `FT_COMPONENT' */
|
||||
#define FT_TRACE_COMP( x ) FT_TRACE_COMP_( x )
|
||||
#define FT_TRACE_COMP_( x ) trace_ ## x
|
||||
|
||||
#define FT_TRACE( level, varformat ) \
|
||||
do \
|
||||
{ \
|
||||
if ( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] >= level ) \
|
||||
FT_Message varformat; \
|
||||
} while ( 0 )
|
||||
#define FT_TRACE( level, varformat ) FT_LOG( level, varformat )
|
||||
|
||||
#else /* !FT_DEBUG_LEVEL_TRACE */
|
||||
|
||||
|
@ -202,8 +271,23 @@ FT_BEGIN_HEADER
|
|||
|
||||
#ifdef FT_DEBUG_LEVEL_ERROR
|
||||
|
||||
#ifdef FT_LOGGING
|
||||
|
||||
#define FT_ERROR( varformat ) \
|
||||
do \
|
||||
{ \
|
||||
const char* dlg_tag = FT_LOGGING_TAG( FT_COMPONENT ); \
|
||||
ft_add_tag( dlg_tag ); \
|
||||
dlg_trace varformat; \
|
||||
ft_remove_tag( dlg_tag ); \
|
||||
} while ( 0 )
|
||||
|
||||
#else
|
||||
|
||||
#define FT_ERROR( varformat ) FT_Message varformat
|
||||
|
||||
#endif /* FT_LOGGING */
|
||||
|
||||
#else /* !FT_DEBUG_LEVEL_ERROR */
|
||||
|
||||
#define FT_ERROR( varformat ) do { } while ( 0 ) /* nothing */
|
||||
|
@ -275,6 +359,58 @@ FT_BEGIN_HEADER
|
|||
FT_BASE( void )
|
||||
ft_debug_init( void );
|
||||
|
||||
#ifdef FT_LOGGING
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* dlg uses output handlers to control how and where the log messages are
|
||||
* printed.
|
||||
* Therefore we need to define an output handler specific to FreeType, it
|
||||
* will act as a default output handler of Freetype.
|
||||
*
|
||||
*/
|
||||
|
||||
FT_BASE( void )
|
||||
ft_log_handler( const struct dlg_origin* origin, const char* string,
|
||||
void* data );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Variable used when FT_LOGGING is enabled to control logging:
|
||||
*
|
||||
* 1. ft_custom_output_handler: stores the function pointer to the callback
|
||||
* function provided by user.
|
||||
*
|
||||
* 2. ft_default_log_handler: stores the function pointer which is used
|
||||
* internally by FreeType to print logs to file.
|
||||
*
|
||||
* These are defined in ftdebug.c
|
||||
*/
|
||||
extern FT_Custom_Log_Handler custom_output_handler;
|
||||
extern dlg_handler ft_default_log_handler;
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* If FT_LOGGING macro is enabled, Freetype needs to initialize and
|
||||
* un-initialize FILE* using following functions
|
||||
* These functions are defined in ftdebug.c
|
||||
*
|
||||
*/
|
||||
|
||||
FT_BASE( void )
|
||||
ft_logging_init( void );
|
||||
|
||||
FT_BASE( void )
|
||||
ft_logging_deinit( void );
|
||||
|
||||
FT_BASE( void )
|
||||
FT_Callback( const char* fmt, ... );
|
||||
|
||||
|
||||
#endif /* FT_LOGGING */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTDEBUG_H_ */
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include <freetype/ftmodapi.h>
|
||||
|
||||
#include "compiler-macros.h"
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include FT_CONFIG_CONFIG_H
|
||||
#include <freetype/fttypes.h>
|
||||
|
||||
#include "compiler-macros.h"
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include <freetype/ftincrem.h>
|
||||
#endif
|
||||
|
||||
#include "compiler-macros.h"
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
@ -225,8 +226,8 @@ FT_BEGIN_HEADER
|
|||
} FT_CMap_ClassRec;
|
||||
|
||||
|
||||
#define FT_DECLARE_CMAP_CLASS( class_ ) \
|
||||
FT_CALLBACK_TABLE const FT_CMap_ClassRec class_;
|
||||
#define FT_DECLARE_CMAP_CLASS( class_ ) \
|
||||
FT_CALLBACK_TABLE const FT_CMap_ClassRec class_;
|
||||
|
||||
#define FT_DEFINE_CMAP_CLASS( \
|
||||
class_, \
|
||||
|
@ -1056,6 +1057,9 @@ FT_BEGIN_HEADER
|
|||
* The struct will be allocated in the global scope (or the scope where
|
||||
* the macro is used).
|
||||
*/
|
||||
#define FT_DECLARE_GLYPH( class_ ) \
|
||||
FT_CALLBACK_TABLE const FT_Glyph_Class class_;
|
||||
|
||||
#define FT_DEFINE_GLYPH( \
|
||||
class_, \
|
||||
size_, \
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#ifndef FTSERV_H_
|
||||
#define FTSERV_H_
|
||||
|
||||
#include "compiler-macros.h"
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
|
|
@ -20,8 +20,9 @@
|
|||
#define FTVALID_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_STANDARD_LIBRARY_H /* for ft_setjmp and ft_longjmp */
|
||||
#include FT_CONFIG_STANDARD_LIBRARY_H /* for ft_jmpbuf */
|
||||
|
||||
#include "compiler-macros.h"
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@
|
|||
if ( !glyph_index )
|
||||
goto Exit;
|
||||
|
||||
FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n",
|
||||
FT_TRACE5(( "standard character: U+%04lX (glyph index %ld)\n",
|
||||
ch, glyph_index ));
|
||||
|
||||
error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
|
||||
|
@ -260,9 +260,9 @@
|
|||
dim == AF_DIMENSION_VERT ? "horizontal"
|
||||
: "vertical" ));
|
||||
|
||||
FT_TRACE5(( " %d (standard)", axis->standard_width ));
|
||||
FT_TRACE5(( " %ld (standard)", axis->standard_width ));
|
||||
for ( i = 1; i < axis->width_count; i++ )
|
||||
FT_TRACE5(( " %d", axis->widths[i].org ));
|
||||
FT_TRACE5(( " %ld", axis->widths[i].org ));
|
||||
|
||||
FT_TRACE5(( "\n" ));
|
||||
}
|
||||
|
@ -727,7 +727,7 @@
|
|||
|
||||
delta2 = FT_MulFix( delta2, scale );
|
||||
|
||||
FT_TRACE5(( "delta: %d", delta1 ));
|
||||
FT_TRACE5(( "delta: %ld", delta1 ));
|
||||
if ( delta2 < 32 )
|
||||
delta2 = 0;
|
||||
#if 0
|
||||
|
@ -736,7 +736,7 @@
|
|||
#endif
|
||||
else
|
||||
delta2 = FT_PIX_ROUND( delta2 );
|
||||
FT_TRACE5(( "/%d\n", delta2 ));
|
||||
FT_TRACE5(( "/%ld\n", delta2 ));
|
||||
|
||||
if ( delta1 < 0 )
|
||||
delta2 = -delta2;
|
||||
|
@ -1643,7 +1643,7 @@
|
|||
|
||||
stem_edge->pos = base_edge->pos + fitted_width;
|
||||
|
||||
FT_TRACE5(( " CJKLINK: edge %d @%d (opos=%.2f) linked to %.2f,"
|
||||
FT_TRACE5(( " CJKLINK: edge %ld @%d (opos=%.2f) linked to %.2f,"
|
||||
" dist was %.2f, now %.2f\n",
|
||||
stem_edge - hints->axis[dim].edges, stem_edge->fpos,
|
||||
stem_edge->opos / 64.0, stem_edge->pos / 64.0,
|
||||
|
@ -1865,7 +1865,7 @@
|
|||
continue;
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
FT_TRACE5(( " CJKBLUE: edge %d @%d (opos=%.2f) snapped to %.2f,"
|
||||
FT_TRACE5(( " CJKBLUE: edge %ld @%d (opos=%.2f) snapped to %.2f,"
|
||||
" was %.2f\n",
|
||||
edge1 - edges, edge1->fpos, edge1->opos / 64.0,
|
||||
blue->fit / 64.0, edge1->pos / 64.0 ));
|
||||
|
@ -1929,7 +1929,7 @@
|
|||
/* this should not happen, but it's better to be safe */
|
||||
if ( edge2->blue_edge )
|
||||
{
|
||||
FT_TRACE5(( "ASSERTION FAILED for edge %d\n", edge2-edges ));
|
||||
FT_TRACE5(( "ASSERTION FAILED for edge %ld\n", edge2-edges ));
|
||||
|
||||
af_cjk_align_linked_edge( hints, dim, edge2, edge );
|
||||
edge->flags |= AF_EDGE_DONE;
|
||||
|
|
|
@ -306,7 +306,7 @@
|
|||
if ( !( count % 10 ) )
|
||||
FT_TRACE4(( " " ));
|
||||
|
||||
FT_TRACE4(( " %d", idx ));
|
||||
FT_TRACE4(( " %ld", idx ));
|
||||
count++;
|
||||
|
||||
if ( !( count % 10 ) )
|
||||
|
|
|
@ -154,7 +154,7 @@
|
|||
goto Exit;
|
||||
}
|
||||
|
||||
FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n",
|
||||
FT_TRACE5(( "standard character: U+%04lX (glyph index %ld)\n",
|
||||
ch, glyph_index ));
|
||||
|
||||
error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
|
||||
|
@ -257,9 +257,9 @@
|
|||
dim == AF_DIMENSION_VERT ? "horizontal"
|
||||
: "vertical" ));
|
||||
|
||||
FT_TRACE5(( " %d (standard)", axis->standard_width ));
|
||||
FT_TRACE5(( " %ld (standard)", axis->standard_width ));
|
||||
for ( i = 1; i < axis->width_count; i++ )
|
||||
FT_TRACE5(( " %d", axis->widths[i].org ));
|
||||
FT_TRACE5(( " %ld", axis->widths[i].org ));
|
||||
|
||||
FT_TRACE5(( "\n" ));
|
||||
}
|
||||
|
@ -1031,7 +1031,7 @@
|
|||
{
|
||||
*a = *b;
|
||||
FT_TRACE5(( "blue zone overlap:"
|
||||
" adjusting %s %d to %ld\n",
|
||||
" adjusting %s %ld to %ld\n",
|
||||
a_is_top ? "overshoot" : "reference",
|
||||
blue_sorted[i] - axis->blues,
|
||||
*a ));
|
||||
|
@ -1279,7 +1279,7 @@
|
|||
"af_latin_metrics_scale_dim:"
|
||||
" x height alignment (style `%s'):\n"
|
||||
" "
|
||||
" vertical scaling changed from %.5f to %.5f (by %d%%)\n"
|
||||
" vertical scaling changed from %.5f to %.5f (by %ld%%)\n"
|
||||
"\n",
|
||||
af_style_names[metrics->root.style_class->style],
|
||||
scale / 65536.0,
|
||||
|
@ -1332,7 +1332,7 @@
|
|||
width->cur = FT_MulFix( width->org, scale );
|
||||
width->fit = width->cur;
|
||||
|
||||
FT_TRACE5(( " %d scaled to %.2f\n",
|
||||
FT_TRACE5(( " %ld scaled to %.2f\n",
|
||||
width->org,
|
||||
width->cur / 64.0 ));
|
||||
}
|
||||
|
@ -1473,8 +1473,8 @@
|
|||
AF_LatinBlue blue = &axis->blues[nn];
|
||||
|
||||
|
||||
FT_TRACE5(( " reference %d: %d scaled to %.2f%s\n"
|
||||
" overshoot %d: %d scaled to %.2f%s\n",
|
||||
FT_TRACE5(( " reference %d: %ld scaled to %.2f%s\n"
|
||||
" overshoot %d: %ld scaled to %.2f%s\n",
|
||||
nn,
|
||||
blue->ref.org,
|
||||
blue->ref.fit / 64.0,
|
||||
|
@ -2944,7 +2944,7 @@
|
|||
|
||||
stem_edge->pos = base_edge->pos + fitted_width;
|
||||
|
||||
FT_TRACE5(( " LINK: edge %d (opos=%.2f) linked to %.2f,"
|
||||
FT_TRACE5(( " LINK: edge %ld (opos=%.2f) linked to %.2f,"
|
||||
" dist was %.2f, now %.2f\n",
|
||||
stem_edge - hints->axis[dim].edges, stem_edge->opos / 64.0,
|
||||
stem_edge->pos / 64.0, dist / 64.0, fitted_width / 64.0 ));
|
||||
|
@ -3068,12 +3068,12 @@
|
|||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
if ( !anchor )
|
||||
FT_TRACE5(( " BLUE_ANCHOR: edge %d (opos=%.2f) snapped to %.2f,"
|
||||
" was %.2f (anchor=edge %d)\n",
|
||||
FT_TRACE5(( " BLUE_ANCHOR: edge %ld (opos=%.2f) snapped to %.2f,"
|
||||
" was %.2f (anchor=edge %ld)\n",
|
||||
edge1 - edges, edge1->opos / 64.0, blue->fit / 64.0,
|
||||
edge1->pos / 64.0, edge - edges ));
|
||||
else
|
||||
FT_TRACE5(( " BLUE: edge %d (opos=%.2f) snapped to %.2f,"
|
||||
FT_TRACE5(( " BLUE: edge %ld (opos=%.2f) snapped to %.2f,"
|
||||
" was %.2f\n",
|
||||
edge1 - edges, edge1->opos / 64.0, blue->fit / 64.0,
|
||||
edge1->pos / 64.0 ));
|
||||
|
@ -3122,7 +3122,7 @@
|
|||
/* this should not happen, but it's better to be safe */
|
||||
if ( edge2->blue_edge )
|
||||
{
|
||||
FT_TRACE5(( " ASSERTION FAILED for edge %d\n", edge2 - edges ));
|
||||
FT_TRACE5(( " ASSERTION FAILED for edge %ld\n", edge2 - edges ));
|
||||
|
||||
af_latin_align_linked_edge( hints, dim, edge2, edge );
|
||||
edge->flags |= AF_EDGE_DONE;
|
||||
|
@ -3190,7 +3190,7 @@
|
|||
anchor = edge;
|
||||
edge->flags |= AF_EDGE_DONE;
|
||||
|
||||
FT_TRACE5(( " ANCHOR: edge %d (opos=%.2f) and %d (opos=%.2f)"
|
||||
FT_TRACE5(( " ANCHOR: edge %ld (opos=%.2f) and %ld (opos=%.2f)"
|
||||
" snapped to %.2f and %.2f\n",
|
||||
edge - edges, edge->opos / 64.0,
|
||||
edge2 - edges, edge2->opos / 64.0,
|
||||
|
@ -3219,7 +3219,7 @@
|
|||
|
||||
if ( edge2->flags & AF_EDGE_DONE )
|
||||
{
|
||||
FT_TRACE5(( " ADJUST: edge %d (pos=%.2f) moved to %.2f\n",
|
||||
FT_TRACE5(( " ADJUST: edge %ld (pos=%.2f) moved to %.2f\n",
|
||||
edge - edges, edge->pos / 64.0,
|
||||
( edge2->pos - cur_len ) / 64.0 ));
|
||||
|
||||
|
@ -3260,7 +3260,7 @@
|
|||
edge->pos = cur_pos1 - cur_len / 2;
|
||||
edge2->pos = cur_pos1 + cur_len / 2;
|
||||
|
||||
FT_TRACE5(( " STEM: edge %d (opos=%.2f) linked to %d (opos=%.2f)"
|
||||
FT_TRACE5(( " STEM: edge %ld (opos=%.2f) linked to %ld (opos=%.2f)"
|
||||
" snapped to %.2f and %.2f\n",
|
||||
edge - edges, edge->opos / 64.0,
|
||||
edge2 - edges, edge2->opos / 64.0,
|
||||
|
@ -3291,7 +3291,7 @@
|
|||
edge->pos = ( delta1 < delta2 ) ? cur_pos1 : cur_pos2;
|
||||
edge2->pos = edge->pos + cur_len;
|
||||
|
||||
FT_TRACE5(( " STEM: edge %d (opos=%.2f) linked to %d (opos=%.2f)"
|
||||
FT_TRACE5(( " STEM: edge %ld (opos=%.2f) linked to %ld (opos=%.2f)"
|
||||
" snapped to %.2f and %.2f\n",
|
||||
edge - edges, edge->opos / 64.0,
|
||||
edge2 - edges, edge2->opos / 64.0,
|
||||
|
@ -3314,7 +3314,7 @@
|
|||
if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 )
|
||||
{
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n",
|
||||
FT_TRACE5(( " BOUND: edge %ld (pos=%.2f) moved to %.2f\n",
|
||||
edge - edges,
|
||||
edge->pos / 64.0,
|
||||
edge[-1].pos / 64.0 ));
|
||||
|
@ -3416,7 +3416,7 @@
|
|||
if ( delta < 64 + 16 )
|
||||
{
|
||||
af_latin_align_serif_edge( hints, edge->serif, edge );
|
||||
FT_TRACE5(( " SERIF: edge %d (opos=%.2f) serif to %d (opos=%.2f)"
|
||||
FT_TRACE5(( " SERIF: edge %ld (opos=%.2f) serif to %ld (opos=%.2f)"
|
||||
" aligned to %.2f\n",
|
||||
edge - edges, edge->opos / 64.0,
|
||||
edge->serif - edges, edge->serif->opos / 64.0,
|
||||
|
@ -3426,7 +3426,7 @@
|
|||
{
|
||||
edge->pos = FT_PIX_ROUND( edge->opos );
|
||||
anchor = edge;
|
||||
FT_TRACE5(( " SERIF_ANCHOR: edge %d (opos=%.2f)"
|
||||
FT_TRACE5(( " SERIF_ANCHOR: edge %ld (opos=%.2f)"
|
||||
" snapped to %.2f\n",
|
||||
edge-edges, edge->opos / 64.0, edge->pos / 64.0 ));
|
||||
}
|
||||
|
@ -3454,8 +3454,8 @@
|
|||
after->pos - before->pos,
|
||||
after->opos - before->opos );
|
||||
|
||||
FT_TRACE5(( " SERIF_LINK1: edge %d (opos=%.2f) snapped to %.2f"
|
||||
" from %d (opos=%.2f)\n",
|
||||
FT_TRACE5(( " SERIF_LINK1: edge %ld (opos=%.2f) snapped to %.2f"
|
||||
" from %ld (opos=%.2f)\n",
|
||||
edge - edges, edge->opos / 64.0,
|
||||
edge->pos / 64.0,
|
||||
before - edges, before->opos / 64.0 ));
|
||||
|
@ -3464,7 +3464,7 @@
|
|||
{
|
||||
edge->pos = anchor->pos +
|
||||
( ( edge->opos - anchor->opos + 16 ) & ~31 );
|
||||
FT_TRACE5(( " SERIF_LINK2: edge %d (opos=%.2f)"
|
||||
FT_TRACE5(( " SERIF_LINK2: edge %ld (opos=%.2f)"
|
||||
" snapped to %.2f\n",
|
||||
edge - edges, edge->opos / 64.0, edge->pos / 64.0 ));
|
||||
}
|
||||
|
@ -3484,7 +3484,7 @@
|
|||
if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 )
|
||||
{
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n",
|
||||
FT_TRACE5(( " BOUND: edge %ld (pos=%.2f) moved to %.2f\n",
|
||||
edge - edges,
|
||||
edge->pos / 64.0,
|
||||
edge[-1].pos / 64.0 ));
|
||||
|
@ -3505,7 +3505,7 @@
|
|||
if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 )
|
||||
{
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n",
|
||||
FT_TRACE5(( " BOUND: edge %ld (pos=%.2f) moved to %.2f\n",
|
||||
edge - edges,
|
||||
edge->pos / 64.0,
|
||||
edge[1].pos / 64.0 ));
|
||||
|
|
|
@ -149,7 +149,7 @@
|
|||
if ( !af_style_classes[ss] )
|
||||
{
|
||||
FT_TRACE0(( "af_property_set: Invalid value %d for property `%s'\n",
|
||||
fallback_script, property_name ));
|
||||
*fallback_script, property_name ));
|
||||
return FT_THROW( Invalid_Argument );
|
||||
}
|
||||
|
||||
|
@ -550,8 +550,8 @@
|
|||
NULL, /* reset_face */
|
||||
NULL, /* get_global_hints */
|
||||
NULL, /* done_global_hints */
|
||||
(FT_AutoHinter_GlyphLoadFunc)af_autofitter_load_glyph ) /* load_glyph */
|
||||
|
||||
(FT_AutoHinter_GlyphLoadFunc)af_autofitter_load_glyph /* load_glyph */
|
||||
)
|
||||
|
||||
FT_DEFINE_MODULE(
|
||||
autofit_module_class,
|
||||
|
|
|
@ -46,6 +46,7 @@ FT_BEGIN_HEADER
|
|||
} AF_ModuleRec, *AF_Module;
|
||||
|
||||
|
||||
FT_DECLARE_AUTOHINTER_INTERFACE( af_autofitter_interface )
|
||||
FT_DECLARE_MODULE( autofit_module_class )
|
||||
|
||||
|
||||
|
|
|
@ -26,6 +26,10 @@
|
|||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
FT_DECLARE_GLYPH( ft_bitmap_glyph_class )
|
||||
FT_DECLARE_GLYPH( ft_outline_glyph_class )
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_MAC_FONTS
|
||||
|
||||
/* MacOS resource fork cannot exceed 16MB at least for Carbon code; */
|
||||
|
|
|
@ -908,13 +908,13 @@
|
|||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
FT_TRACE5(( "FT_Bitmap_Blend:\n"
|
||||
" source bitmap: (%d, %d) -- (%d, %d); %d x %d\n",
|
||||
" source bitmap: (%ld, %ld) -- (%ld, %ld); %d x %d\n",
|
||||
source_llx / 64, source_lly / 64,
|
||||
source_urx / 64, source_ury / 64,
|
||||
source_->width, source_->rows ));
|
||||
|
||||
if ( target->width && target->rows )
|
||||
FT_TRACE5(( " target bitmap: (%d, %d) -- (%d, %d); %d x %d\n",
|
||||
FT_TRACE5(( " target bitmap: (%ld, %ld) -- (%ld, %ld); %d x %d\n",
|
||||
target_llx / 64, target_lly / 64,
|
||||
target_urx / 64, target_ury / 64,
|
||||
target->width, target->rows ));
|
||||
|
@ -922,7 +922,7 @@
|
|||
FT_TRACE5(( " target bitmap: empty\n" ));
|
||||
|
||||
if ( final_width && final_rows )
|
||||
FT_TRACE5(( " final bitmap: (%d, %d) -- (%d, %d); %d x %d\n",
|
||||
FT_TRACE5(( " final bitmap: (%ld, %ld) -- (%ld, %ld); %d x %d\n",
|
||||
final_llx / 64, final_lly / 64,
|
||||
final_urx / 64, final_ury / 64,
|
||||
final_width, final_rows ));
|
||||
|
|
|
@ -44,6 +44,46 @@
|
|||
#include <freetype/freetype.h>
|
||||
#include <freetype/internal/ftdebug.h>
|
||||
|
||||
#ifdef FT_LOGGING
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Variable used when FT_LOGGING is enabled to control logging:
|
||||
*
|
||||
* 1. ft_default_trace_level: stores the value of trace levels which are
|
||||
* provided to FreeType using FT2_DEBUG environment variable.
|
||||
*
|
||||
* 2. ft_custom_trace_level: stores the value of custom trace level which
|
||||
* is provided by user at run-time.
|
||||
*
|
||||
* 3. ft_component: a string that holds the name of FT_COMPONENT
|
||||
*
|
||||
* 4. ft_fileptr: store the FILE*
|
||||
*
|
||||
* 5. ft_component_flag: a flag when is true, prints FT_COMPONENT along
|
||||
* with log message if `-v` is defined in FT2_DEBUG
|
||||
* 6. ft_timestamp_flag: a flag when is true, prints time in millisec along
|
||||
* with log message if `-t` is define in FT2_DEBUG
|
||||
* 7. ft_have_newline_char: It is used to differentiate between a log
|
||||
* message with '\n' char and log message without '\n' char
|
||||
*
|
||||
* Static Variables are defined here to remove [ -Wunused-variable ]
|
||||
* warning
|
||||
*
|
||||
*/
|
||||
static const char* ft_default_trace_level = NULL;
|
||||
static const char* ft_custom_trace_level = NULL;
|
||||
static const char* ft_component = NULL;
|
||||
static FILE* ft_fileptr = NULL;
|
||||
static bool ft_component_flag = false;
|
||||
static bool ft_timestamp_flag = false;
|
||||
static bool ft_have_newline_char = true;
|
||||
|
||||
FT_Custom_Log_Handler custom_output_handler = NULL;
|
||||
dlg_handler ft_default_log_handler = NULL;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_ERROR
|
||||
|
||||
|
@ -195,7 +235,18 @@
|
|||
FT_BASE_DEF( void )
|
||||
ft_debug_init( void )
|
||||
{
|
||||
const char* ft2_debug = ft_getenv( "FT2_DEBUG" );
|
||||
const char* ft2_debug = NULL;
|
||||
|
||||
#ifdef FT_LOGGING
|
||||
|
||||
if( ft_custom_trace_level != NULL )
|
||||
ft2_debug = ft_custom_trace_level;
|
||||
else
|
||||
ft2_debug = ft_default_trace_level;
|
||||
|
||||
#else
|
||||
ft2_debug = ft_getenv( "FT2_DEBUG" );
|
||||
#endif /* FT_LOGGIGN */
|
||||
|
||||
|
||||
if ( ft2_debug )
|
||||
|
@ -206,10 +257,40 @@
|
|||
|
||||
for ( ; *p; p++ )
|
||||
{
|
||||
|
||||
/* skip leading whitespace and separators */
|
||||
if ( *p == ' ' || *p == '\t' || *p == ',' || *p == ';' || *p == '=' )
|
||||
continue;
|
||||
|
||||
#ifdef FT_LOGGING
|
||||
/* check extra arguments for logging */
|
||||
if( *p == '-' )
|
||||
{
|
||||
const char* r = ++p;
|
||||
if( *r == 'v' )
|
||||
{
|
||||
ft_component_flag = true;
|
||||
const char* s = ++r;
|
||||
if( *s == 't' )
|
||||
{
|
||||
ft_timestamp_flag = true;
|
||||
p++;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
else if( *r == 't' )
|
||||
{
|
||||
ft_timestamp_flag = true;
|
||||
const char* s = ++r;
|
||||
if( *s == 'v' )
|
||||
{
|
||||
ft_component_flag = true;
|
||||
p++;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
}
|
||||
#endif /* FT_LOGGING */
|
||||
/* read toggle name, followed by ':' */
|
||||
q = p;
|
||||
while ( *p && *p != ':' )
|
||||
|
@ -314,5 +395,156 @@
|
|||
|
||||
#endif /* !FT_DEBUG_LEVEL_TRACE */
|
||||
|
||||
#ifdef FT_LOGGING
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* If FT_LOGGING is enabled, FreeType needs to initialize all logging
|
||||
* variables to write logs.
|
||||
* Therefore it uses `ft_logging_init()` function to initialize a
|
||||
* loggging variables and `ft_logging_deinit()` to un-initialize the
|
||||
* logging variables.
|
||||
*
|
||||
*/
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
ft_logging_init( void )
|
||||
{
|
||||
ft_default_log_handler = ft_log_handler;
|
||||
ft_default_trace_level = ft_getenv( "FT2_DEBUG" );
|
||||
if( ft_getenv( "FT_LOGGING_FILE" ) )
|
||||
ft_fileptr = fopen( ft_getenv( "FT_LOGGING_FILE" ) , "w" );
|
||||
else
|
||||
ft_fileptr = stderr;
|
||||
|
||||
ft_debug_init();
|
||||
/* We need to set the default FreeType specific dlg's output handler */
|
||||
dlg_set_handler( ft_default_log_handler, NULL );
|
||||
|
||||
}
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
ft_logging_deinit( void )
|
||||
{
|
||||
fclose( ft_fileptr );
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* An Output log handler specific to FreeType used by dlg library.
|
||||
*
|
||||
*/
|
||||
FT_BASE_DEF( void )
|
||||
ft_log_handler( const struct dlg_origin* origin,
|
||||
const char* string, void* data )
|
||||
{
|
||||
( void ) data;
|
||||
const char* features ;
|
||||
if( ft_timestamp_flag && ft_component_flag && ft_have_newline_char )
|
||||
features = "[%h:%m %t] %c";
|
||||
else if( ft_component_flag && ft_have_newline_char)
|
||||
features = "[%t] %c";
|
||||
else if( ft_timestamp_flag && ft_have_newline_char )
|
||||
features = "[%t] %c";
|
||||
else
|
||||
features = "%c";
|
||||
|
||||
dlg_generic_outputf_stream( ft_fileptr, features, origin, string,
|
||||
dlg_default_output_styles, true );
|
||||
|
||||
|
||||
if( strchr( string, '\n' ) )
|
||||
ft_have_newline_char = true;
|
||||
else
|
||||
ft_have_newline_char = false;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Functions to set trace levels at run-time
|
||||
* 1. FT_Trace_Set_Level() - Use this function to change the trace level
|
||||
* at run-time. e.g. FT_Trace_Set_Level( "any:6 io:2" );
|
||||
*
|
||||
* 2. FT_Trace_Set_Default_Level() - Use this function to set the default
|
||||
* value of trace levels which is provided by environment variable
|
||||
* FT2_DEBUG
|
||||
*
|
||||
*/
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
FT_Trace_Set_Level( const char* level )
|
||||
{
|
||||
ft_component_flag = NULL;
|
||||
ft_timestamp_flag = NULL;
|
||||
ft_custom_trace_level = level;
|
||||
ft_debug_init();
|
||||
}
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
FT_Trace_Set_Default_Level( void )
|
||||
{
|
||||
ft_component_flag = NULL;
|
||||
ft_timestamp_flag = NULL;
|
||||
ft_custom_trace_level = NULL ;
|
||||
ft_debug_init();
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Functions to handle custom log handler:
|
||||
*
|
||||
*/
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
FT_Set_Log_Handler( FT_Custom_Log_Handler handler )
|
||||
{
|
||||
custom_output_handler = handler;
|
||||
}
|
||||
|
||||
FT_EXPORT_DEF( void )
|
||||
FT_Set_Default_Log_Handler()
|
||||
{
|
||||
custom_output_handler = NULL;
|
||||
}
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
FT_Callback( const char* fmt, ... )
|
||||
{
|
||||
va_list ap;
|
||||
va_start( ap, fmt );
|
||||
custom_output_handler( ft_component , fmt, ap );
|
||||
va_end( ap );
|
||||
}
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
ft_add_tag( const char* tag )
|
||||
{
|
||||
ft_component = tag;
|
||||
dlg_add_tag( tag, NULL );
|
||||
}
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
ft_remove_tag( const char* tag )
|
||||
{
|
||||
dlg_remove_tag( tag, NULL );
|
||||
}
|
||||
|
||||
#else /* ! FT_LOGGING */
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
ft_add_tag( const char* tag )
|
||||
{
|
||||
FT_UNUSED(tag);
|
||||
/* nothing */
|
||||
}
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
ft_remove_tag( const char* tag )
|
||||
{
|
||||
FT_UNUSED (tag);
|
||||
/* nothing */
|
||||
}
|
||||
|
||||
#endif /* FT_LOGGING */
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
#include <freetype/ftbitmap.h>
|
||||
#include <freetype/internal/ftobjs.h>
|
||||
|
||||
#include "ftbase.h"
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
|
|
|
@ -202,6 +202,11 @@
|
|||
FT_Memory memory;
|
||||
|
||||
|
||||
/* If logging is enabled initialize the FILE* */
|
||||
#ifdef FT_LOGGING
|
||||
ft_logging_init();
|
||||
#endif /* FT_LOGGING */
|
||||
|
||||
/* check of `alibrary' delayed to `FT_New_Library' */
|
||||
|
||||
/* First of all, allocate a new system object -- this function is part */
|
||||
|
@ -248,6 +253,11 @@
|
|||
/* discard memory manager */
|
||||
FT_Done_Memory( memory );
|
||||
|
||||
/* If logging is enabled we need to close the FILE* */
|
||||
#ifdef FT_LOGGING
|
||||
ft_logging_deinit();
|
||||
#endif /* FT_LOGGING */
|
||||
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
|
||||
|
|
|
@ -1841,15 +1841,15 @@
|
|||
/* FT2 allocator takes signed long buffer length,
|
||||
* too large value causing overflow should be checked
|
||||
*/
|
||||
FT_TRACE4(( " POST fragment #%d: length=0x%08x"
|
||||
" total pfb_len=0x%08x\n",
|
||||
FT_TRACE4(( " POST fragment #%d: length=0x%08lx"
|
||||
" total pfb_len=0x%08lx\n",
|
||||
i, temp, pfb_len + temp + 6 ));
|
||||
|
||||
if ( FT_MAC_RFORK_MAX_LEN < temp ||
|
||||
FT_MAC_RFORK_MAX_LEN - temp < pfb_len + 6 )
|
||||
{
|
||||
FT_TRACE2(( " MacOS resource length cannot exceed"
|
||||
" 0x%08x\n",
|
||||
" 0x%08lx\n",
|
||||
FT_MAC_RFORK_MAX_LEN ));
|
||||
|
||||
error = FT_THROW( Invalid_Offset );
|
||||
|
@ -1860,13 +1860,13 @@
|
|||
}
|
||||
|
||||
FT_TRACE2(( " total buffer size to concatenate"
|
||||
" %d POST fragments: 0x%08x\n",
|
||||
" %ld POST fragments: 0x%08lx\n",
|
||||
resource_cnt, pfb_len + 2 ));
|
||||
|
||||
if ( pfb_len + 2 < 6 )
|
||||
{
|
||||
FT_TRACE2(( " too long fragment length makes"
|
||||
" pfb_len confused: pfb_len=0x%08x\n",
|
||||
" pfb_len confused: pfb_len=0x%08lx\n",
|
||||
pfb_len ));
|
||||
|
||||
error = FT_THROW( Array_Too_Large );
|
||||
|
@ -1909,7 +1909,7 @@
|
|||
goto Exit2;
|
||||
|
||||
FT_TRACE3(( "POST fragment[%d]:"
|
||||
" offsets=0x%08x, rlen=0x%08x, flags=0x%04x\n",
|
||||
" offsets=0x%08lx, rlen=0x%08lx, flags=0x%04x\n",
|
||||
i, offsets[i], rlen, flags ));
|
||||
|
||||
error = FT_ERR( Array_Too_Large );
|
||||
|
@ -1936,8 +1936,8 @@
|
|||
else
|
||||
{
|
||||
FT_TRACE3(( " Write POST fragment #%d header (4-byte) to buffer"
|
||||
" %p + 0x%08x\n",
|
||||
i, pfb_data, pfb_lenpos ));
|
||||
" %p + 0x%08lx\n",
|
||||
i, ( void* )pfb_data, pfb_lenpos ));
|
||||
|
||||
if ( pfb_lenpos + 3 > pfb_len + 2 )
|
||||
goto Exit2;
|
||||
|
@ -1951,8 +1951,8 @@
|
|||
break;
|
||||
|
||||
FT_TRACE3(( " Write POST fragment #%d header (6-byte) to buffer"
|
||||
" %p + 0x%08x\n",
|
||||
i, pfb_data, pfb_pos ));
|
||||
" %p + 0x%08lx\n",
|
||||
i, ( void* )pfb_data, pfb_pos ));
|
||||
|
||||
if ( pfb_pos + 6 > pfb_len + 2 )
|
||||
goto Exit2;
|
||||
|
@ -1973,9 +1973,9 @@
|
|||
if ( pfb_pos > pfb_len || pfb_pos + rlen > pfb_len )
|
||||
goto Exit2;
|
||||
|
||||
FT_TRACE3(( " Load POST fragment #%d (%d byte) to buffer"
|
||||
" %p + 0x%08x\n",
|
||||
i, rlen, pfb_data, pfb_pos ));
|
||||
FT_TRACE3(( " Load POST fragment #%d (%ld byte) to buffer"
|
||||
" %p + 0x%08lx\n",
|
||||
i, rlen, ( void* )pfb_data, pfb_pos ));
|
||||
|
||||
error = FT_Stream_Read( stream, (FT_Byte *)pfb_data + pfb_pos, rlen );
|
||||
if ( error )
|
||||
|
@ -2259,7 +2259,7 @@
|
|||
args2.flags = FT_OPEN_PATHNAME;
|
||||
args2.pathname = file_names[i] ? file_names[i] : args->pathname;
|
||||
|
||||
FT_TRACE3(( "Try rule %d: %s (offset=%d) ...",
|
||||
FT_TRACE3(( "Try rule %d: %s (offset=%ld) ...",
|
||||
i, args2.pathname, offsets[i] ));
|
||||
|
||||
error = FT_Stream_New( library, &args2, &stream2 );
|
||||
|
@ -3214,9 +3214,9 @@
|
|||
FT_Size_Metrics* metrics = &face->size->metrics;
|
||||
|
||||
|
||||
FT_TRACE5(( " x scale: %d (%f)\n",
|
||||
FT_TRACE5(( " x scale: %ld (%f)\n",
|
||||
metrics->x_scale, metrics->x_scale / 65536.0 ));
|
||||
FT_TRACE5(( " y scale: %d (%f)\n",
|
||||
FT_TRACE5(( " y scale: %ld (%f)\n",
|
||||
metrics->y_scale, metrics->y_scale / 65536.0 ));
|
||||
FT_TRACE5(( " ascender: %f\n", metrics->ascender / 64.0 ));
|
||||
FT_TRACE5(( " descender: %f\n", metrics->descender / 64.0 ));
|
||||
|
@ -3289,9 +3289,9 @@
|
|||
FT_Size_Metrics* metrics = &face->size->metrics;
|
||||
|
||||
|
||||
FT_TRACE5(( " x scale: %d (%f)\n",
|
||||
FT_TRACE5(( " x scale: %ld (%f)\n",
|
||||
metrics->x_scale, metrics->x_scale / 65536.0 ));
|
||||
FT_TRACE5(( " y scale: %d (%f)\n",
|
||||
FT_TRACE5(( " y scale: %ld (%f)\n",
|
||||
metrics->y_scale, metrics->y_scale / 65536.0 ));
|
||||
FT_TRACE5(( " ascender: %f\n", metrics->ascender / 64.0 ));
|
||||
FT_TRACE5(( " descender: %f\n", metrics->descender / 64.0 ));
|
||||
|
@ -3451,7 +3451,7 @@
|
|||
if ( akerning->x != orig_x_rounded ||
|
||||
akerning->y != orig_y_rounded )
|
||||
FT_TRACE5(( "FT_Get_Kerning: horizontal kerning"
|
||||
" (%d, %d) scaled down to (%d, %d) pixels\n",
|
||||
" (%ld, %ld) scaled down to (%ld, %ld) pixels\n",
|
||||
orig_x_rounded / 64, orig_y_rounded / 64,
|
||||
akerning->x / 64, akerning->y / 64 ));
|
||||
}
|
||||
|
@ -3723,7 +3723,7 @@
|
|||
if ( charcode > 0xFFFFFFFFUL )
|
||||
{
|
||||
FT_TRACE1(( "FT_Get_Char_Index: too large charcode" ));
|
||||
FT_TRACE1(( " 0x%x is truncated\n", charcode ));
|
||||
FT_TRACE1(( " 0x%lx is truncated\n", charcode ));
|
||||
}
|
||||
|
||||
result = cmap->clazz->char_index( cmap, (FT_UInt32)charcode );
|
||||
|
@ -3899,13 +3899,13 @@
|
|||
{
|
||||
FT_TRACE1(( "FT_Face_GetCharVariantIndex:"
|
||||
" too large charcode" ));
|
||||
FT_TRACE1(( " 0x%x is truncated\n", charcode ));
|
||||
FT_TRACE1(( " 0x%lx is truncated\n", charcode ));
|
||||
}
|
||||
if ( variantSelector > 0xFFFFFFFFUL )
|
||||
{
|
||||
FT_TRACE1(( "FT_Face_GetCharVariantIndex:"
|
||||
" too large variantSelector" ));
|
||||
FT_TRACE1(( " 0x%x is truncated\n", variantSelector ));
|
||||
FT_TRACE1(( " 0x%lx is truncated\n", variantSelector ));
|
||||
}
|
||||
|
||||
result = vcmap->clazz->char_var_index( vcmap, ucmap,
|
||||
|
@ -3942,13 +3942,13 @@
|
|||
{
|
||||
FT_TRACE1(( "FT_Face_GetCharVariantIsDefault:"
|
||||
" too large charcode" ));
|
||||
FT_TRACE1(( " 0x%x is truncated\n", charcode ));
|
||||
FT_TRACE1(( " 0x%lx is truncated\n", charcode ));
|
||||
}
|
||||
if ( variantSelector > 0xFFFFFFFFUL )
|
||||
{
|
||||
FT_TRACE1(( "FT_Face_GetCharVariantIsDefault:"
|
||||
" too large variantSelector" ));
|
||||
FT_TRACE1(( " 0x%x is truncated\n", variantSelector ));
|
||||
FT_TRACE1(( " 0x%lx is truncated\n", variantSelector ));
|
||||
}
|
||||
|
||||
result = vcmap->clazz->char_var_default( vcmap,
|
||||
|
@ -4011,7 +4011,7 @@
|
|||
if ( charcode > 0xFFFFFFFFUL )
|
||||
{
|
||||
FT_TRACE1(( "FT_Face_GetVariantsOfChar: too large charcode" ));
|
||||
FT_TRACE1(( " 0x%x is truncated\n", charcode ));
|
||||
FT_TRACE1(( " 0x%lx is truncated\n", charcode ));
|
||||
}
|
||||
|
||||
result = vcmap->clazz->charvariant_list( vcmap, memory,
|
||||
|
@ -4045,7 +4045,7 @@
|
|||
if ( variantSelector > 0xFFFFFFFFUL )
|
||||
{
|
||||
FT_TRACE1(( "FT_Get_Char_Index: too large variantSelector" ));
|
||||
FT_TRACE1(( " 0x%x is truncated\n", variantSelector ));
|
||||
FT_TRACE1(( " 0x%lx is truncated\n", variantSelector ));
|
||||
}
|
||||
|
||||
result = vcmap->clazz->variantchar_list( vcmap, memory,
|
||||
|
@ -5273,10 +5273,12 @@
|
|||
if ( !memory || !alibrary )
|
||||
return FT_THROW( Invalid_Argument );
|
||||
|
||||
#ifndef FT_LOGGING
|
||||
#ifdef FT_DEBUG_LEVEL_ERROR
|
||||
/* init debugging support */
|
||||
ft_debug_init();
|
||||
#endif
|
||||
#endif /* FT_DEBUG_LEVEL_ERROR */
|
||||
#endif /* FT_LOGGING */
|
||||
|
||||
/* first of all, allocate the library object */
|
||||
if ( FT_NEW( library ) )
|
||||
|
|
|
@ -274,7 +274,7 @@
|
|||
first = (FT_UInt)last + 1;
|
||||
}
|
||||
|
||||
FT_TRACE5(( "FT_Outline_Decompose: Done\n", n ));
|
||||
FT_TRACE5(( "FT_Outline_Decompose: Done\n" ));
|
||||
return FT_Err_Ok;
|
||||
|
||||
Invalid_Outline:
|
||||
|
|
|
@ -239,7 +239,7 @@
|
|||
(char)( 0xFF & ( tag_internal >> 16 ) ),
|
||||
(char)( 0xFF & ( tag_internal >> 8 ) ),
|
||||
(char)( 0xFF & ( tag_internal >> 0 ) ) ));
|
||||
FT_TRACE3(( " : subcount=%d, suboffset=0x%04x\n",
|
||||
FT_TRACE3(( " : subcount=%d, suboffset=0x%04lx\n",
|
||||
subcnt, rpos ));
|
||||
|
||||
if ( tag_internal == tag )
|
||||
|
@ -285,7 +285,7 @@
|
|||
ref[j].offset = temp & 0xFFFFFFL;
|
||||
|
||||
FT_TRACE3(( " [%d]:"
|
||||
" resource_id=0x%04x, offset=0x%08x\n",
|
||||
" resource_id=0x%04x, offset=0x%08lx\n",
|
||||
j, (FT_UShort)ref[j].res_id, ref[j].offset ));
|
||||
}
|
||||
|
||||
|
@ -301,7 +301,7 @@
|
|||
|
||||
for ( j = 0; j < *count; j++ )
|
||||
FT_TRACE3(( " [%d]:"
|
||||
" resource_id=0x%04x, offset=0x%08x\n",
|
||||
" resource_id=0x%04x, offset=0x%08lx\n",
|
||||
j, ref[j].res_id, ref[j].offset ));
|
||||
}
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@
|
|||
if ( ( ystr >> 6 ) > FT_INT_MAX || ( ystr >> 6 ) < FT_INT_MIN )
|
||||
{
|
||||
FT_TRACE1(( "FT_GlyphSlot_Embolden:" ));
|
||||
FT_TRACE1(( "too strong emboldening parameter ystr=%d\n", ystr ));
|
||||
FT_TRACE1(( "too strong emboldening parameter ystr=%ld\n", ystr ));
|
||||
return;
|
||||
}
|
||||
error = FT_GlyphSlot_Own_Bitmap( slot );
|
||||
|
|
|
@ -275,7 +275,7 @@
|
|||
stream->close = ft_ansi_stream_close;
|
||||
|
||||
FT_TRACE1(( "FT_Stream_Open:" ));
|
||||
FT_TRACE1(( " opened `%s' (%d bytes) successfully\n",
|
||||
FT_TRACE1(( " opened `%s' (%ld bytes) successfully\n",
|
||||
filepathname, stream->size ));
|
||||
|
||||
return FT_Err_Ok;
|
||||
|
|
|
@ -183,7 +183,8 @@ THE SOFTWARE.
|
|||
Exit:
|
||||
if ( charcode > 0xFFFFFFFFUL )
|
||||
{
|
||||
FT_TRACE1(( "bdf_cmap_char_next: charcode 0x%x > 32bit API" ));
|
||||
FT_TRACE1(( "bdf_cmap_char_next: charcode 0x%lx > 32bit API",
|
||||
charcode ));
|
||||
*acharcode = 0;
|
||||
/* XXX: result should be changed to indicate an overflow error */
|
||||
}
|
||||
|
@ -401,10 +402,10 @@ THE SOFTWARE.
|
|||
bdf_property_t* prop = NULL;
|
||||
|
||||
|
||||
FT_TRACE4(( " number of glyphs: allocated %d (used %d)\n",
|
||||
FT_TRACE4(( " number of glyphs: allocated %ld (used %ld)\n",
|
||||
font->glyphs_size,
|
||||
font->glyphs_used ));
|
||||
FT_TRACE4(( " number of unencoded glyphs: allocated %d (used %d)\n",
|
||||
FT_TRACE4(( " number of unencoded glyphs: allocated %ld (used %ld)\n",
|
||||
font->unencoded_size,
|
||||
font->unencoded_used ));
|
||||
|
||||
|
@ -456,13 +457,13 @@ THE SOFTWARE.
|
|||
if ( font->font_ascent > 0x7FFF || font->font_ascent < -0x7FFF )
|
||||
{
|
||||
font->font_ascent = font->font_ascent < 0 ? -0x7FFF : 0x7FFF;
|
||||
FT_TRACE0(( "BDF_Face_Init: clamping font ascent to value %d\n",
|
||||
FT_TRACE0(( "BDF_Face_Init: clamping font ascent to value %ld\n",
|
||||
font->font_ascent ));
|
||||
}
|
||||
if ( font->font_descent > 0x7FFF || font->font_descent < -0x7FFF )
|
||||
{
|
||||
font->font_descent = font->font_descent < 0 ? -0x7FFF : 0x7FFF;
|
||||
FT_TRACE0(( "BDF_Face_Init: clamping font descent to value %d\n",
|
||||
FT_TRACE0(( "BDF_Face_Init: clamping font descent to value %ld\n",
|
||||
font->font_descent ));
|
||||
}
|
||||
|
||||
|
@ -503,7 +504,7 @@ THE SOFTWARE.
|
|||
prop->value.l < -0x504C2L )
|
||||
{
|
||||
bsize->size = 0x7FFF;
|
||||
FT_TRACE0(( "BDF_Face_Init: clamping point size to value %d\n",
|
||||
FT_TRACE0(( "BDF_Face_Init: clamping point size to value %ld\n",
|
||||
bsize->size ));
|
||||
}
|
||||
else
|
||||
|
@ -516,7 +517,7 @@ THE SOFTWARE.
|
|||
if ( font->point_size > 0x7FFF )
|
||||
{
|
||||
bsize->size = 0x7FFF;
|
||||
FT_TRACE0(( "BDF_Face_Init: clamping point size to value %d\n",
|
||||
FT_TRACE0(( "BDF_Face_Init: clamping point size to value %ld\n",
|
||||
bsize->size ));
|
||||
}
|
||||
else
|
||||
|
@ -538,7 +539,7 @@ THE SOFTWARE.
|
|||
if ( prop->value.l > 0x7FFF || prop->value.l < -0x7FFF )
|
||||
{
|
||||
bsize->y_ppem = 0x7FFF << 6;
|
||||
FT_TRACE0(( "BDF_Face_Init: clamping pixel size to value %d\n",
|
||||
FT_TRACE0(( "BDF_Face_Init: clamping pixel size to value %ld\n",
|
||||
bsize->y_ppem ));
|
||||
}
|
||||
else
|
||||
|
@ -614,7 +615,7 @@ THE SOFTWARE.
|
|||
for ( n = 0; n < font->glyphs_size; n++ )
|
||||
{
|
||||
(face->en_table[n]).enc = cur[n].encoding;
|
||||
FT_TRACE4(( " idx %d, val 0x%lX\n", n, cur[n].encoding ));
|
||||
FT_TRACE4(( " idx %ld, val 0x%lX\n", n, cur[n].encoding ));
|
||||
(face->en_table[n]).glyph = (FT_UShort)n;
|
||||
|
||||
if ( cur[n].encoding == font->default_char )
|
||||
|
@ -623,7 +624,7 @@ THE SOFTWARE.
|
|||
face->default_glyph = (FT_UInt)n;
|
||||
else
|
||||
FT_TRACE1(( "BDF_Face_Init:"
|
||||
" idx %d is too large for this system\n", n ));
|
||||
" idx %ld is too large for this system\n", n ));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -824,7 +825,7 @@ THE SOFTWARE.
|
|||
bitmap->rows = glyph.bbx.height;
|
||||
bitmap->width = glyph.bbx.width;
|
||||
if ( glyph.bpr > FT_INT_MAX )
|
||||
FT_TRACE1(( "BDF_Glyph_Load: too large pitch %d is truncated\n",
|
||||
FT_TRACE1(( "BDF_Glyph_Load: too large pitch %ld is truncated\n",
|
||||
glyph.bpr ));
|
||||
bitmap->pitch = (int)glyph.bpr; /* same as FT_Bitmap.pitch */
|
||||
|
||||
|
@ -901,7 +902,8 @@ THE SOFTWARE.
|
|||
if ( prop->value.l > 0x7FFFFFFFL || prop->value.l < ( -1 - 0x7FFFFFFFL ) )
|
||||
{
|
||||
FT_TRACE1(( "bdf_get_bdf_property:"
|
||||
" too large integer 0x%x is truncated\n" ));
|
||||
" too large integer 0x%lx is truncated\n",
|
||||
prop->value.l ));
|
||||
}
|
||||
aproperty->type = BDF_PROPERTY_TYPE_INTEGER;
|
||||
aproperty->u.integer = (FT_Int32)prop->value.l;
|
||||
|
@ -911,7 +913,8 @@ THE SOFTWARE.
|
|||
if ( prop->value.ul > 0xFFFFFFFFUL )
|
||||
{
|
||||
FT_TRACE1(( "bdf_get_bdf_property:"
|
||||
" too large cardinal 0x%x is truncated\n" ));
|
||||
" too large cardinal 0x%lx is truncated\n",
|
||||
prop->value.ul ));
|
||||
}
|
||||
aproperty->type = BDF_PROPERTY_TYPE_CARDINAL;
|
||||
aproperty->u.cardinal = (FT_UInt32)prop->value.ul;
|
||||
|
|
|
@ -185,12 +185,12 @@
|
|||
"Added `FONT_ASCENT %hd'.\n"
|
||||
#define ACMSG2 "FONT_DESCENT property missing. " \
|
||||
"Added `FONT_DESCENT %hd'.\n"
|
||||
#define ACMSG3 "Font width != actual width. Old: %hd New: %hd.\n"
|
||||
#define ACMSG3 "Font width != actual width. Old: %d New: %d.\n"
|
||||
#define ACMSG4 "Font left bearing != actual left bearing. " \
|
||||
"Old: %hd New: %hd.\n"
|
||||
#define ACMSG5 "Font ascent != actual ascent. Old: %hd New: %hd.\n"
|
||||
#define ACMSG6 "Font descent != actual descent. Old: %hd New: %hd.\n"
|
||||
#define ACMSG7 "Font height != actual height. Old: %hd New: %hd.\n"
|
||||
#define ACMSG7 "Font height != actual height. Old: %d New: %d.\n"
|
||||
#define ACMSG8 "Glyph scalable width (SWIDTH) adjustments made.\n"
|
||||
#define ACMSG9 "SWIDTH field missing at line %ld. Set automatically.\n"
|
||||
#define ACMSG10 "DWIDTH field missing at line %ld. Set to glyph width.\n"
|
||||
|
|
|
@ -110,7 +110,9 @@
|
|||
|
||||
if ( (FT_ULong)face->num_glyphs > FT_UINT_MAX || 0 > face->num_glyphs )
|
||||
FT_TRACE1(( "ftc_basic_family_get_count:"
|
||||
" too large number of glyphs in this face, truncated\n",
|
||||
" the number of glyphs in this face is %ld,\n"
|
||||
" "
|
||||
" which is too much and thus truncated\n",
|
||||
face->num_glyphs ));
|
||||
|
||||
if ( !error )
|
||||
|
@ -393,7 +395,7 @@
|
|||
#if FT_ULONG_MAX > FT_UINT_MAX
|
||||
if ( load_flags > FT_UINT_MAX )
|
||||
FT_TRACE1(( "FTC_ImageCache_LookupScaler:"
|
||||
" higher bits in load_flags 0x%x are dropped\n",
|
||||
" higher bits in load_flags 0x%lx are dropped\n",
|
||||
load_flags & ~((FT_ULong)FT_UINT_MAX) ));
|
||||
#endif
|
||||
|
||||
|
@ -593,7 +595,7 @@
|
|||
#if FT_ULONG_MAX > FT_UINT_MAX
|
||||
if ( load_flags > FT_UINT_MAX )
|
||||
FT_TRACE1(( "FTC_ImageCache_LookupScaler:"
|
||||
" higher bits in load_flags 0x%x are dropped\n",
|
||||
" higher bits in load_flags 0x%lx are dropped\n",
|
||||
load_flags & ~((FT_ULong)FT_UINT_MAX) ));
|
||||
#endif
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#ifndef FTCCACHE_H_
|
||||
#define FTCCACHE_H_
|
||||
|
||||
|
||||
#include <freetype/internal/compiler-macros.h>
|
||||
#include "ftcmru.h"
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "ftcglyph.h"
|
||||
#include "ftcsbits.h"
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
FT_LOCAL( void )
|
||||
ftc_inode_free( FTC_Node inode,
|
||||
|
@ -84,6 +85,7 @@
|
|||
ftc_node_destroy( FTC_Node node,
|
||||
FTC_Manager manager );
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTCCBACK_H_ */
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
#include <freetype/internal/compiler-macros.h>
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
|
|
|
@ -43,7 +43,7 @@ FT_BEGIN_HEADER
|
|||
} CFF_CMapStdRec;
|
||||
|
||||
|
||||
FT_DECLARE_CMAP_CLASS(cff_cmap_encoding_class_rec)
|
||||
FT_DECLARE_CMAP_CLASS( cff_cmap_encoding_class_rec )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
@ -56,7 +56,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
/* unicode (synthetic) cmaps */
|
||||
|
||||
FT_DECLARE_CMAP_CLASS(cff_cmap_unicode_class_rec)
|
||||
FT_DECLARE_CMAP_CLASS( cff_cmap_unicode_class_rec )
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
|
|
@ -737,7 +737,7 @@
|
|||
{
|
||||
if ( dict->cid_supplement < FT_INT_MIN ||
|
||||
dict->cid_supplement > FT_INT_MAX )
|
||||
FT_TRACE1(( "cff_get_ros: too large supplement %d is truncated\n",
|
||||
FT_TRACE1(( "cff_get_ros: too large supplement %ld is truncated\n",
|
||||
dict->cid_supplement ));
|
||||
*supplement = (FT_Int)dict->cid_supplement;
|
||||
}
|
||||
|
|
|
@ -442,7 +442,7 @@
|
|||
if ( cur_offset != 0 )
|
||||
{
|
||||
FT_TRACE0(( "cff_index_get_pointers:"
|
||||
" invalid first offset value %d set to zero\n",
|
||||
" invalid first offset value %ld set to zero\n",
|
||||
cur_offset ));
|
||||
cur_offset = 0;
|
||||
}
|
||||
|
@ -559,8 +559,8 @@
|
|||
idx->data_offset > stream->size - off2 + 1 )
|
||||
{
|
||||
FT_ERROR(( "cff_index_access_element:"
|
||||
" offset to next entry (%d)"
|
||||
" exceeds the end of stream (%d)\n",
|
||||
" offset to next entry (%ld)"
|
||||
" exceeds the end of stream (%ld)\n",
|
||||
off2, stream->size - idx->data_offset + 1 ));
|
||||
off2 = stream->size - idx->data_offset + 1;
|
||||
}
|
||||
|
@ -984,7 +984,7 @@
|
|||
if ( glyph_sid > 0xFFFFL - nleft )
|
||||
{
|
||||
FT_ERROR(( "cff_charset_load: invalid SID range trimmed"
|
||||
" nleft=%d -> %d\n", nleft, 0xFFFFL - glyph_sid ));
|
||||
" nleft=%d -> %ld\n", nleft, 0xFFFFL - glyph_sid ));
|
||||
nleft = ( FT_UInt )( 0xFFFFL - glyph_sid );
|
||||
}
|
||||
|
||||
|
@ -1951,7 +1951,7 @@
|
|||
if ( priv->blue_shift > 1000 || priv->blue_shift < 0 )
|
||||
{
|
||||
FT_TRACE2(( "cff_load_private_dict:"
|
||||
" setting unlikely BlueShift value %d to default (7)\n",
|
||||
" setting unlikely BlueShift value %ld to default (7)\n",
|
||||
priv->blue_shift ));
|
||||
priv->blue_shift = 7;
|
||||
}
|
||||
|
@ -1959,7 +1959,7 @@
|
|||
if ( priv->blue_fuzz > 1000 || priv->blue_fuzz < 0 )
|
||||
{
|
||||
FT_TRACE2(( "cff_load_private_dict:"
|
||||
" setting unlikely BlueFuzz value %d to default (1)\n",
|
||||
" setting unlikely BlueFuzz value %ld to default (1)\n",
|
||||
priv->blue_fuzz ));
|
||||
priv->blue_fuzz = 1;
|
||||
}
|
||||
|
|
|
@ -713,7 +713,7 @@
|
|||
( max_scaling - min_scaling ) > 9 )
|
||||
{
|
||||
FT_TRACE1(( "cff_parse_font_matrix:"
|
||||
" strange scaling values (minimum %d, maximum %d),\n"
|
||||
" strange scaling values (minimum %ld, maximum %ld),\n"
|
||||
" "
|
||||
" using default matrix\n", min_scaling, max_scaling ));
|
||||
goto Unlikely;
|
||||
|
@ -810,7 +810,7 @@
|
|||
bbox->yMax = FT_RoundFix( cff_parse_fixed( parser, data ) );
|
||||
error = FT_Err_Ok;
|
||||
|
||||
FT_TRACE4(( " [%d %d %d %d]\n",
|
||||
FT_TRACE4(( " [%ld %ld %ld %ld]\n",
|
||||
bbox->xMin / 65536,
|
||||
bbox->yMin / 65536,
|
||||
bbox->xMax / 65536,
|
||||
|
@ -933,11 +933,11 @@
|
|||
FT_TRACE1(( "cff_parse_cid_ros: real supplement is rounded\n" ));
|
||||
dict->cid_supplement = cff_parse_num( parser, data );
|
||||
if ( dict->cid_supplement < 0 )
|
||||
FT_TRACE1(( "cff_parse_cid_ros: negative supplement %d is found\n",
|
||||
FT_TRACE1(( "cff_parse_cid_ros: negative supplement %ld is found\n",
|
||||
dict->cid_supplement ));
|
||||
error = FT_Err_Ok;
|
||||
|
||||
FT_TRACE4(( " %d %d %d\n",
|
||||
FT_TRACE4(( " %d %d %ld\n",
|
||||
dict->cid_registry,
|
||||
dict->cid_ordering,
|
||||
dict->cid_supplement ));
|
||||
|
@ -1263,11 +1263,11 @@
|
|||
FT_Byte* charstring_base;
|
||||
FT_ULong charstring_len;
|
||||
|
||||
FT_Fixed* stack;
|
||||
FT_ListNode node;
|
||||
CFF_T2_String t2;
|
||||
size_t t2_size;
|
||||
FT_Byte* q;
|
||||
FT_Fixed* stack;
|
||||
FT_ListNode node;
|
||||
CFF_T2_String t2;
|
||||
FT_Fixed t2_size;
|
||||
FT_Byte* q;
|
||||
|
||||
|
||||
charstring_base = ++p;
|
||||
|
|
|
@ -254,7 +254,7 @@
|
|||
goto Exit;
|
||||
}
|
||||
|
||||
FT_TRACE4(( " %d\n", num_dicts ));
|
||||
FT_TRACE4(( " %ld\n", num_dicts ));
|
||||
|
||||
/*
|
||||
* A single entry in the FDArray must (at least) contain the following
|
||||
|
@ -275,7 +275,7 @@
|
|||
if ( (FT_ULong)num_dicts > stream->size / 100 )
|
||||
{
|
||||
FT_TRACE0(( "parse_fd_array: adjusting FDArray size"
|
||||
" (from %d to %d)\n",
|
||||
" (from %ld to %ld)\n",
|
||||
num_dicts,
|
||||
stream->size / 100 ));
|
||||
num_dicts = (FT_Long)( stream->size / 100 );
|
||||
|
@ -329,7 +329,7 @@
|
|||
dict->expansion_factor = cid_parser_to_fixed( parser, 0 );
|
||||
dict->private_dict.expansion_factor = dict->expansion_factor;
|
||||
|
||||
FT_TRACE4(( "%d\n", dict->expansion_factor ));
|
||||
FT_TRACE4(( "%ld\n", dict->expansion_factor ));
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -804,7 +804,7 @@
|
|||
face->root.stream->size - parser->data_offset )
|
||||
{
|
||||
FT_TRACE0(( "cid_face_open: adjusting length of binary data\n"
|
||||
" (from %d to %d bytes)\n",
|
||||
" (from %ld to %ld bytes)\n",
|
||||
parser->binary_length,
|
||||
face->root.stream->size - parser->data_offset ));
|
||||
parser->binary_length = face->root.stream->size -
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
#
|
||||
# FreeType 2 dlg logging library configuration rules
|
||||
#
|
||||
|
||||
|
||||
# Copyright (C) 1996-2020 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
# and distributed under the terms of the FreeType project license,
|
||||
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
|
||||
# indicate that you have read the license and understand and accept it
|
||||
# fully.
|
||||
|
||||
|
||||
# dlg logging library directory
|
||||
#
|
||||
DLG_DIR := $(SRC_DIR)/dlg
|
||||
|
||||
DLG_COMPILE := $(CC) $(ANSIFLAGS) \
|
||||
$I$(subst /,$(COMPILER_SEP),$(DLG_DIR)) \
|
||||
$(INCLUDE_FLAGS) \
|
||||
$(FT_CFLAGS)
|
||||
|
||||
|
||||
# dlg logging library sources (i.e., C files)
|
||||
#
|
||||
DLG_SRC := $(DLG_DIR)/dlg.c
|
||||
|
||||
# dlg logging library headers
|
||||
#
|
||||
DLG_H := $(DLG_DIR)/dlg/dlg.h \
|
||||
$(DLG_DIR)/dlg/output.h
|
||||
|
||||
|
||||
# dlg logging library object(s)
|
||||
#
|
||||
# DLG_OBJ_M is used during `multi' builds
|
||||
# DLG_OBJ_S is used during `single' builds
|
||||
#
|
||||
DLG_OBJ_M := $(DLG_SRC:$(DLG_DIR)/%.c=$(OBJ_DIR)/%.$O)
|
||||
DLG_OBJ_S := $(OBJ_DIR)/dlg.$O
|
||||
|
||||
# dlg logging library source file for single build
|
||||
#
|
||||
DLG_SRC_S := $(DLG_DIR)/dlg.c
|
||||
|
||||
|
||||
# dlg logging library - single object
|
||||
#
|
||||
$(DLG_OBJ_S): $(DLG_SRC_S) $(DLG_SRC) $(FREETYPE_H) $(DLG_H)
|
||||
$(DLG_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(DLG_SRC_S))
|
||||
|
||||
|
||||
# dlg logging library - multiple objects
|
||||
#
|
||||
$(OBJ_DIR)/%.$O: $(DLG_DIR)/%.c $(FREETYPE_H) $(DLG_H)
|
||||
$(DLG_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
|
||||
|
||||
|
||||
# update main object lists
|
||||
#
|
||||
DLG_OBJS_S += $(DLG_OBJ_S)
|
||||
DLG_OBJS_M += $(DLG_OBJ_M)
|
||||
|
||||
|
||||
# EOF
|
|
@ -34,6 +34,9 @@
|
|||
#include <freetype/ftsnames.h>
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
typedef struct GXV_mort_featureRec_
|
||||
{
|
||||
FT_UShort featureType;
|
||||
|
@ -88,6 +91,8 @@
|
|||
GXV_Validator gxvalid );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* GXVMORT_H_ */
|
||||
|
||||
|
||||
|
|
|
@ -36,6 +36,9 @@
|
|||
#include <freetype/ftsnames.h>
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
FT_LOCAL( void )
|
||||
gxv_morx_subtable_type0_validate( FT_Bytes table,
|
||||
FT_Bytes limit,
|
||||
|
@ -62,6 +65,8 @@
|
|||
GXV_Validator gxvalid );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* GXVMORX_H_ */
|
||||
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/*
|
||||
* This is a complete re-implementation of the LZW file reader,
|
||||
|
@ -165,6 +166,8 @@
|
|||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTZOPEN_H_ */
|
||||
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ THE SOFTWARE.
|
|||
FT_UInt32 charcode = *acharcode;
|
||||
FT_UShort charcodeRow;
|
||||
FT_UShort charcodeCol;
|
||||
FT_Int result = 0;
|
||||
FT_UInt result = 0;
|
||||
|
||||
|
||||
while ( charcode < (FT_UInt32)( enc->lastRow * 256 + enc->lastCol ) )
|
||||
|
@ -606,8 +606,9 @@ THE SOFTWARE.
|
|||
if ( prop->value.l > 0x7FFFFFFFL ||
|
||||
prop->value.l < ( -1 - 0x7FFFFFFFL ) )
|
||||
{
|
||||
FT_TRACE1(( "pcf_get_bdf_property:" ));
|
||||
FT_TRACE1(( " too large integer 0x%x is truncated\n" ));
|
||||
FT_TRACE1(( "pcf_get_bdf_property:"
|
||||
" too large integer 0x%lx is truncated\n",
|
||||
prop->value.l ));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -121,7 +121,7 @@ THE SOFTWARE.
|
|||
toc->count > 9 )
|
||||
{
|
||||
FT_TRACE0(( "pcf_read_TOC: adjusting number of tables"
|
||||
" (from %d to %d)\n",
|
||||
" (from %ld to %ld)\n",
|
||||
toc->count,
|
||||
FT_MIN( stream->size >> 4, 9 ) ));
|
||||
toc->count = FT_MIN( stream->size >> 4, 9 );
|
||||
|
@ -241,7 +241,7 @@ THE SOFTWARE.
|
|||
if ( tables[i].type == (FT_UInt)( 1 << j ) )
|
||||
name = tableNames[j];
|
||||
|
||||
FT_TRACE4(( " %d: type=%s, format=0x%X,"
|
||||
FT_TRACE4(( " %d: type=%s, format=0x%lX,"
|
||||
" size=%ld (0x%lX), offset=%ld (0x%lX)\n",
|
||||
i, name,
|
||||
tables[i].format,
|
||||
|
@ -660,7 +660,7 @@ THE SOFTWARE.
|
|||
{
|
||||
properties[i].value.l = props[i].value;
|
||||
|
||||
FT_TRACE4(( " %d\n", properties[i].value.l ));
|
||||
FT_TRACE4(( " %ld\n", properties[i].value.l ));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -797,7 +797,7 @@ THE SOFTWARE.
|
|||
metrics->descent = 0;
|
||||
|
||||
FT_TRACE0(( "pcf_get_metrics:"
|
||||
" invalid metrics for glyph %d\n", i ));
|
||||
" invalid metrics for glyph %ld\n", i ));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -917,11 +917,11 @@ THE SOFTWARE.
|
|||
|
||||
sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX( format )];
|
||||
|
||||
FT_TRACE4(( " %ld-bit padding implies a size of %lu\n",
|
||||
FT_TRACE4(( " %d-bit padding implies a size of %lu\n",
|
||||
8 << i, bitmapSizes[i] ));
|
||||
}
|
||||
|
||||
FT_TRACE4(( " %lu bitmaps, using %ld-bit padding\n",
|
||||
FT_TRACE4(( " %lu bitmaps, using %d-bit padding\n",
|
||||
nbitmaps,
|
||||
8 << PCF_GLYPH_PAD_INDEX( format ) ));
|
||||
FT_TRACE4(( " bitmap size: %lu\n", sizebitmaps ));
|
||||
|
@ -1251,13 +1251,13 @@ THE SOFTWARE.
|
|||
if ( FT_ABS( accel->fontAscent ) > 0x7FFF )
|
||||
{
|
||||
accel->fontAscent = accel->fontAscent < 0 ? -0x7FFF : 0x7FFF;
|
||||
FT_TRACE0(( "pfc_get_accel: clamping font ascent to value %d\n",
|
||||
FT_TRACE0(( "pfc_get_accel: clamping font ascent to value %ld\n",
|
||||
accel->fontAscent ));
|
||||
}
|
||||
if ( FT_ABS( accel->fontDescent ) > 0x7FFF )
|
||||
{
|
||||
accel->fontDescent = accel->fontDescent < 0 ? -0x7FFF : 0x7FFF;
|
||||
FT_TRACE0(( "pfc_get_accel: clamping font descent to value %d\n",
|
||||
FT_TRACE0(( "pfc_get_accel: clamping font descent to value %ld\n",
|
||||
accel->fontDescent ));
|
||||
}
|
||||
|
||||
|
@ -1630,7 +1630,7 @@ THE SOFTWARE.
|
|||
if ( FT_ABS( prop->value.l ) > 0x504C2L ) /* 0x7FFF * 72270/7200 */
|
||||
{
|
||||
bsize->size = 0x7FFF;
|
||||
FT_TRACE0(( "pcf_load_font: clamping point size to value %d\n",
|
||||
FT_TRACE0(( "pcf_load_font: clamping point size to value %ld\n",
|
||||
bsize->size ));
|
||||
}
|
||||
else
|
||||
|
@ -1649,7 +1649,7 @@ THE SOFTWARE.
|
|||
if ( FT_ABS( prop->value.l ) > 0x7FFF )
|
||||
{
|
||||
bsize->y_ppem = 0x7FFF << 6;
|
||||
FT_TRACE0(( "pcf_load_font: clamping pixel size to value %d\n",
|
||||
FT_TRACE0(( "pcf_load_font: clamping pixel size to value %ld\n",
|
||||
bsize->y_ppem ));
|
||||
}
|
||||
else
|
||||
|
|
|
@ -31,7 +31,7 @@ THE SOFTWARE.
|
|||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_CONFIG_H
|
||||
|
||||
#include <freetype/internal/compiler-macros.h>
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
|
|
@ -451,7 +451,7 @@
|
|||
case 1: /* 16-bit absolute value */
|
||||
PFR_CHECK( 2 );
|
||||
cur->x = PFR_NEXT_SHORT( p );
|
||||
FT_TRACE7(( " x.%d", cur->x ));
|
||||
FT_TRACE7(( " x.%ld", cur->x ));
|
||||
break;
|
||||
|
||||
case 2: /* 8-bit delta */
|
||||
|
@ -481,7 +481,7 @@
|
|||
case 1: /* 16-bit absolute value */
|
||||
PFR_CHECK( 2 );
|
||||
cur->y = PFR_NEXT_SHORT( p );
|
||||
FT_TRACE7(( " y.%d", cur->y ));
|
||||
FT_TRACE7(( " y.%ld", cur->y ));
|
||||
break;
|
||||
|
||||
case 2: /* 8-bit delta */
|
||||
|
|
|
@ -745,7 +745,7 @@
|
|||
ypos + (FT_Long)ysize < FT_INT_MIN )
|
||||
{
|
||||
FT_TRACE1(( "pfr_slot_load_bitmap:" ));
|
||||
FT_TRACE1(( "huge bitmap glyph %dx%d over FT_GlyphSlot\n",
|
||||
FT_TRACE1(( "huge bitmap glyph %ldx%ld over FT_GlyphSlot\n",
|
||||
xpos, ypos ));
|
||||
error = FT_THROW( Invalid_Pixel_Size );
|
||||
}
|
||||
|
|
|
@ -2153,7 +2153,7 @@
|
|||
decoder->locals_bias );
|
||||
|
||||
|
||||
FT_TRACE4(( " callsubr (idx %d, entering level %d)\n",
|
||||
FT_TRACE4(( " callsubr (idx %d, entering level %ld)\n",
|
||||
idx,
|
||||
zone - decoder->zones + 1 ));
|
||||
|
||||
|
@ -2197,7 +2197,7 @@
|
|||
decoder->globals_bias );
|
||||
|
||||
|
||||
FT_TRACE4(( " callgsubr (idx %d, entering level %d)\n",
|
||||
FT_TRACE4(( " callgsubr (idx %d, entering level %ld)\n",
|
||||
idx,
|
||||
zone - decoder->zones + 1 ));
|
||||
|
||||
|
@ -2236,7 +2236,7 @@
|
|||
break;
|
||||
|
||||
case cff_op_return:
|
||||
FT_TRACE4(( " return (leaving level %d)\n",
|
||||
FT_TRACE4(( " return (leaving level %ld)\n",
|
||||
decoder->zone - decoder->zones ));
|
||||
|
||||
if ( decoder->zone <= decoder->zones )
|
||||
|
|
|
@ -170,9 +170,9 @@
|
|||
};
|
||||
|
||||
|
||||
FT_CALLBACK_TABLE_DEF
|
||||
const FT_Module_Class psaux_module_class =
|
||||
{
|
||||
FT_DEFINE_MODULE(
|
||||
psaux_module_class,
|
||||
|
||||
0,
|
||||
sizeof ( FT_ModuleRec ),
|
||||
"psaux",
|
||||
|
@ -184,7 +184,7 @@
|
|||
(FT_Module_Constructor)NULL, /* module_init */
|
||||
(FT_Module_Destructor) NULL, /* module_done */
|
||||
(FT_Module_Requester) NULL /* get_interface */
|
||||
};
|
||||
)
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -34,10 +34,24 @@ FT_BEGIN_HEADER
|
|||
FT_CALLBACK_TABLE
|
||||
const PS_Builder_FuncsRec ps_builder_funcs;
|
||||
|
||||
#ifndef T1_CONFIG_OPTION_NO_AFM
|
||||
FT_CALLBACK_TABLE
|
||||
const AFM_Parser_FuncsRec afm_parser_funcs;
|
||||
#endif
|
||||
|
||||
FT_CALLBACK_TABLE
|
||||
const T1_CMap_ClassesRec t1_cmap_classes;
|
||||
|
||||
FT_CALLBACK_TABLE
|
||||
const CFF_Decoder_FuncsRec cff_decoder_funcs;
|
||||
|
||||
|
||||
FT_EXPORT_VAR( const FT_Module_Class ) psaux_driver_class;
|
||||
|
||||
|
||||
FT_DECLARE_MODULE( psaux_module_class )
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* PSAUXMOD_H_ */
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
|
||||
|
||||
#include <freetype/fterrors.h>
|
||||
#include <freetype/internal/compiler-macros.h>
|
||||
#include "psft.h"
|
||||
|
||||
|
||||
|
|
|
@ -40,9 +40,9 @@
|
|||
#define PSFT_H_
|
||||
|
||||
|
||||
#include <freetype/internal/compiler-macros.h>
|
||||
#include "pstypes.h"
|
||||
|
||||
|
||||
/* TODO: disable asserts for now */
|
||||
#define CF2_NDEBUG
|
||||
|
||||
|
|
|
@ -310,7 +310,7 @@
|
|||
CF2_Hint hint = &hintmap->edge[i];
|
||||
|
||||
|
||||
FT_TRACE6(( " %3d %7.2f %7.2f %5d %s%s%s%s\n",
|
||||
FT_TRACE6(( " %3ld %7.2f %7.2f %5d %s%s%s%s\n",
|
||||
hint->index,
|
||||
hint->csCoord / 65536.0,
|
||||
hint->dsCoord / ( hint->scale * 1.0 ),
|
||||
|
|
|
@ -1232,7 +1232,7 @@
|
|||
bbox->xMax = FT_RoundFix( temp[2] );
|
||||
bbox->yMax = FT_RoundFix( temp[3] );
|
||||
|
||||
FT_TRACE4(( " [%d %d %d %d]",
|
||||
FT_TRACE4(( " [%ld %ld %ld %ld]",
|
||||
bbox->xMin / 65536,
|
||||
bbox->yMin / 65536,
|
||||
bbox->xMax / 65536,
|
||||
|
@ -1286,7 +1286,7 @@
|
|||
bbox->xMax = FT_RoundFix( temp[i + 2 * max_objects] );
|
||||
bbox->yMax = FT_RoundFix( temp[i + 3 * max_objects] );
|
||||
|
||||
FT_TRACE4(( " [%d %d %d %d]",
|
||||
FT_TRACE4(( " [%ld %ld %ld %ld]",
|
||||
bbox->xMin / 65536,
|
||||
bbox->yMin / 65536,
|
||||
bbox->xMax / 65536,
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#ifndef PSSTACK_H_
|
||||
#define PSSTACK_H_
|
||||
|
||||
#include <freetype/internal/compiler-macros.h>
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
|
|
@ -517,7 +517,7 @@
|
|||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
if ( bol )
|
||||
{
|
||||
FT_TRACE5(( " (%d)", decoder->top - decoder->stack ));
|
||||
FT_TRACE5(( " (%ld)", decoder->top - decoder->stack ));
|
||||
bol = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
@ -1162,7 +1162,7 @@
|
|||
if ( top - decoder->stack != num_args )
|
||||
FT_TRACE0(( "t1_decoder_parse_charstrings:"
|
||||
" too much operands on the stack"
|
||||
" (seen %d, expected %d)\n",
|
||||
" (seen %ld, expected %d)\n",
|
||||
top - decoder->stack, num_args ));
|
||||
break;
|
||||
}
|
||||
|
@ -1209,7 +1209,7 @@
|
|||
FT_TRACE4(( "BuildCharArray = [ " ));
|
||||
|
||||
for ( i = 0; i < decoder->len_buildchar; i++ )
|
||||
FT_TRACE4(( "%d ", decoder->buildchar[i] ));
|
||||
FT_TRACE4(( "%ld ", decoder->buildchar[i] ));
|
||||
|
||||
FT_TRACE4(( "]\n" ));
|
||||
}
|
||||
|
@ -1237,8 +1237,8 @@
|
|||
|
||||
FT_UNUSED( orig_y );
|
||||
|
||||
/* the `metrics_only' indicates that we only want to compute */
|
||||
/* the glyph's metrics (lsb + advance width), not load the */
|
||||
/* `metrics_only' indicates that we only want to compute the */
|
||||
/* glyph's metrics (lsb + advance width) without loading the */
|
||||
/* rest of it; so exit immediately */
|
||||
if ( builder->metrics_only )
|
||||
{
|
||||
|
@ -1272,8 +1272,8 @@
|
|||
x = ADD_LONG( builder->pos_x, top[0] );
|
||||
y = ADD_LONG( builder->pos_y, top[1] );
|
||||
|
||||
/* the `metrics_only' indicates that we only want to compute */
|
||||
/* the glyph's metrics (lsb + advance width), not load the */
|
||||
/* `metrics_only' indicates that we only want to compute the */
|
||||
/* glyph's metrics (lsb + advance width) without loading the */
|
||||
/* rest of it; so exit immediately */
|
||||
if ( builder->metrics_only )
|
||||
{
|
||||
|
@ -1727,7 +1727,7 @@
|
|||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
if ( bol )
|
||||
{
|
||||
FT_TRACE5(( " (%d)", decoder->top - decoder->stack ));
|
||||
FT_TRACE5(( " (%ld)", decoder->top - decoder->stack ));
|
||||
bol = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
@ -1749,8 +1749,6 @@
|
|||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 14:
|
||||
case 15:
|
||||
case 21:
|
||||
|
@ -1759,6 +1757,13 @@
|
|||
case 31:
|
||||
goto No_Width;
|
||||
|
||||
case 10:
|
||||
op = op_callsubr;
|
||||
break;
|
||||
case 11:
|
||||
op = op_return;
|
||||
break;
|
||||
|
||||
case 13:
|
||||
op = op_hsbw;
|
||||
break;
|
||||
|
@ -1898,13 +1903,20 @@
|
|||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
|
||||
if ( op != op_div )
|
||||
switch ( op )
|
||||
{
|
||||
case op_callsubr:
|
||||
case op_div:
|
||||
case op_return:
|
||||
break;
|
||||
|
||||
default:
|
||||
if ( top - decoder->stack != num_args )
|
||||
FT_TRACE0(( "t1_decoder_parse_metrics:"
|
||||
" too much operands on the stack"
|
||||
" (seen %d, expected %d)\n",
|
||||
" (seen %ld, expected %d)\n",
|
||||
top - decoder->stack, num_args ));
|
||||
break;
|
||||
}
|
||||
|
||||
#endif /* FT_DEBUG_LEVEL_TRACE */
|
||||
|
@ -1925,8 +1937,8 @@
|
|||
builder->advance.y = 0;
|
||||
|
||||
/* we only want to compute the glyph's metrics */
|
||||
/* (lsb + advance width), not load the rest of */
|
||||
/* it; so exit immediately */
|
||||
/* (lsb + advance width) without loading the */
|
||||
/* rest of it; so exit immediately */
|
||||
FT_TRACE4(( "\n" ));
|
||||
return FT_Err_Ok;
|
||||
|
||||
|
@ -1944,8 +1956,8 @@
|
|||
builder->advance.y = top[3];
|
||||
|
||||
/* we only want to compute the glyph's metrics */
|
||||
/* (lsb + advance width), not load the rest of */
|
||||
/* it; so exit immediately */
|
||||
/* (lsb + advance width), without loading the */
|
||||
/* rest of it; so exit immediately */
|
||||
FT_TRACE4(( "\n" ));
|
||||
return FT_Err_Ok;
|
||||
|
||||
|
@ -1961,6 +1973,91 @@
|
|||
large_int = FALSE;
|
||||
break;
|
||||
|
||||
case op_callsubr:
|
||||
{
|
||||
FT_Int idx;
|
||||
|
||||
|
||||
FT_TRACE4(( " callsubr" ));
|
||||
|
||||
idx = Fix2Int( top[0] );
|
||||
|
||||
if ( decoder->subrs_hash )
|
||||
{
|
||||
size_t* val = ft_hash_num_lookup( idx,
|
||||
decoder->subrs_hash );
|
||||
|
||||
|
||||
if ( val )
|
||||
idx = *val;
|
||||
else
|
||||
idx = -1;
|
||||
}
|
||||
|
||||
if ( idx < 0 || idx >= decoder->num_subrs )
|
||||
{
|
||||
FT_ERROR(( "t1_decoder_parse_metrics:"
|
||||
" invalid subrs index\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
||||
if ( zone - decoder->zones >= T1_MAX_SUBRS_CALLS )
|
||||
{
|
||||
FT_ERROR(( "t1_decoder_parse_metrics:"
|
||||
" too many nested subrs\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
||||
zone->cursor = ip; /* save current instruction pointer */
|
||||
|
||||
zone++;
|
||||
|
||||
/* The Type 1 driver stores subroutines without the seed bytes. */
|
||||
/* The CID driver stores subroutines with seed bytes. This */
|
||||
/* case is taken care of when decoder->subrs_len == 0. */
|
||||
zone->base = decoder->subrs[idx];
|
||||
|
||||
if ( decoder->subrs_len )
|
||||
zone->limit = zone->base + decoder->subrs_len[idx];
|
||||
else
|
||||
{
|
||||
/* We are using subroutines from a CID font. We must adjust */
|
||||
/* for the seed bytes. */
|
||||
zone->base += ( decoder->lenIV >= 0 ? decoder->lenIV : 0 );
|
||||
zone->limit = decoder->subrs[idx + 1];
|
||||
}
|
||||
|
||||
zone->cursor = zone->base;
|
||||
|
||||
if ( !zone->base )
|
||||
{
|
||||
FT_ERROR(( "t1_decoder_parse_metrics:"
|
||||
" invoking empty subrs\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
||||
decoder->zone = zone;
|
||||
ip = zone->base;
|
||||
limit = zone->limit;
|
||||
break;
|
||||
}
|
||||
|
||||
case op_return:
|
||||
FT_TRACE4(( " return" ));
|
||||
|
||||
if ( zone <= decoder->zones )
|
||||
{
|
||||
FT_ERROR(( "t1_decoder_parse_metrics:"
|
||||
" unexpected return\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
||||
zone--;
|
||||
ip = zone->cursor;
|
||||
limit = zone->limit;
|
||||
decoder->zone = zone;
|
||||
break;
|
||||
|
||||
default:
|
||||
FT_ERROR(( "t1_decoder_parse_metrics:"
|
||||
" unhandled opcode %d\n", op ));
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include <freetype/internal/ftobjs.h>
|
||||
#include "pshrec.h"
|
||||
#include "pshalgo.h"
|
||||
#include "pshmod.h"
|
||||
|
||||
|
||||
/* the Postscript Hinter module structure */
|
||||
|
|
|
@ -874,7 +874,7 @@
|
|||
if ( error )
|
||||
{
|
||||
FT_ERROR(( "ps_hints_stem: could not add stem"
|
||||
" (%d,%d) to hints table\n", stems[0], stems[1] ));
|
||||
" (%ld,%ld) to hints table\n", stems[0], stems[1] ));
|
||||
|
||||
hints->error = error;
|
||||
return;
|
||||
|
|
|
@ -673,13 +673,13 @@
|
|||
if ( overshoot )
|
||||
ras.cProfile->flags |= Overshoot_Bottom;
|
||||
|
||||
FT_TRACE6(( " new ascending profile = %p\n", ras.cProfile ));
|
||||
FT_TRACE6(( " new ascending profile = %p\n", (void *)ras.cProfile ));
|
||||
break;
|
||||
|
||||
case Descending_State:
|
||||
if ( overshoot )
|
||||
ras.cProfile->flags |= Overshoot_Top;
|
||||
FT_TRACE6(( " new descending profile = %p\n", ras.cProfile ));
|
||||
FT_TRACE6(( " new descending profile = %p\n", (void *)ras.cProfile ));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -736,7 +736,7 @@
|
|||
|
||||
|
||||
FT_TRACE6(( " ending profile %p, start = %ld, height = %ld\n",
|
||||
ras.cProfile, ras.cProfile->start, h ));
|
||||
(void *)ras.cProfile, ras.cProfile->start, h ));
|
||||
|
||||
ras.cProfile->height = h;
|
||||
if ( overshoot )
|
||||
|
@ -2273,7 +2273,7 @@
|
|||
if ( e2 >= ras.bWidth )
|
||||
e2 = ras.bWidth - 1;
|
||||
|
||||
FT_TRACE7(( " -> x=[%d;%d]", e1, e2 ));
|
||||
FT_TRACE7(( " -> x=[%ld;%ld]", e1, e2 ));
|
||||
|
||||
c1 = (Short)( e1 >> 3 );
|
||||
c2 = (Short)( e2 >> 3 );
|
||||
|
@ -2447,7 +2447,7 @@
|
|||
|
||||
if ( e1 >= 0 && e1 < ras.bWidth )
|
||||
{
|
||||
FT_TRACE7(( " -> x=%d (drop-out)", e1 ));
|
||||
FT_TRACE7(( " -> x=%ld (drop-out)", e1 ));
|
||||
|
||||
c1 = (Short)( e1 >> 3 );
|
||||
f1 = (Short)( e1 & 7 );
|
||||
|
@ -2521,7 +2521,7 @@
|
|||
PByte bits;
|
||||
|
||||
|
||||
FT_TRACE7(( " -> y=%d (drop-out)", e1 ));
|
||||
FT_TRACE7(( " -> y=%ld (drop-out)", e1 ));
|
||||
|
||||
bits = ras.bOrigin + ( y >> 3 ) - e1 * ras.target.pitch;
|
||||
f1 = (Byte)( 0x80 >> ( y & 7 ) );
|
||||
|
@ -2644,7 +2644,7 @@
|
|||
|
||||
if ( e1 >= 0 && (ULong)e1 < ras.target.rows )
|
||||
{
|
||||
FT_TRACE7(( " -> y=%d (drop-out)", e1 ));
|
||||
FT_TRACE7(( " -> y=%ld (drop-out)", e1 ));
|
||||
|
||||
bits = ras.bOrigin + ( y >> 3 ) - e1 * ras.target.pitch;
|
||||
f1 = (Byte)( 0x80 >> ( y & 7 ) );
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include FT_CONFIG_CONFIG_H
|
||||
#include <freetype/ftimage.h>
|
||||
|
||||
#include <freetype/internal/compiler-macros.h>
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@
|
|||
else if ( (FT_ULong)face->num_glyphs < FT_UINT_MAX )
|
||||
max_gid = (FT_UInt)face->num_glyphs;
|
||||
else
|
||||
FT_TRACE0(( "Ignore glyph names for invalid GID 0x%08x - 0x%08x\n",
|
||||
FT_TRACE0(( "Ignore glyph names for invalid GID 0x%08x - 0x%08lx\n",
|
||||
FT_UINT_MAX, face->num_glyphs ));
|
||||
|
||||
for ( i = 0; i < max_gid; i++ )
|
||||
|
|
|
@ -546,8 +546,8 @@
|
|||
/* Stream may have changed in sfnt_open_font. */
|
||||
stream = face->root.stream;
|
||||
|
||||
FT_TRACE2(( "sfnt_init_face: %08p (index %d)\n",
|
||||
face,
|
||||
FT_TRACE2(( "sfnt_init_face: %p (index %d)\n",
|
||||
(void *)face,
|
||||
face_instance_index ));
|
||||
|
||||
face_index = FT_ABS( face_instance_index ) & 0xFFFF;
|
||||
|
@ -820,7 +820,7 @@
|
|||
/* it doesn't contain outlines. */
|
||||
/* */
|
||||
|
||||
FT_TRACE2(( "sfnt_load_face: %08p\n\n", face ));
|
||||
FT_TRACE2(( "sfnt_load_face: %p\n\n", (void *)face ));
|
||||
|
||||
/* do we have outlines in there? */
|
||||
#ifdef FT_CONFIG_OPTION_INCREMENTAL
|
||||
|
|
|
@ -43,7 +43,8 @@
|
|||
|
||||
#define READ_BASE128( var ) FT_SET_ERROR( ReadBase128( stream, &var ) )
|
||||
|
||||
#define ROUND4( var ) ( ( var + 3 ) & ~3 )
|
||||
/* `var' should be FT_ULong */
|
||||
#define ROUND4( var ) ( ( var + 3 ) & ~3UL )
|
||||
|
||||
#define WRITE_USHORT( p, v ) \
|
||||
do \
|
||||
|
@ -63,12 +64,12 @@
|
|||
\
|
||||
} while ( 0 )
|
||||
|
||||
#define WRITE_SHORT( p, v ) \
|
||||
do \
|
||||
{ \
|
||||
*(p)++ = ( (v) >> 8 ); \
|
||||
*(p)++ = ( (v) >> 0 ); \
|
||||
\
|
||||
#define WRITE_SHORT( p, v ) \
|
||||
do \
|
||||
{ \
|
||||
*(p)++ = (FT_Byte)( (v) >> 8 ); \
|
||||
*(p)++ = (FT_Byte)( (v) >> 0 ); \
|
||||
\
|
||||
} while ( 0 )
|
||||
|
||||
#define WRITE_SFNT_BUF( buf, s ) \
|
||||
|
@ -280,12 +281,12 @@
|
|||
|
||||
|
||||
/* Calculate table checksum of `buf'. */
|
||||
static FT_Long
|
||||
static FT_ULong
|
||||
compute_ULong_sum( FT_Byte* buf,
|
||||
FT_ULong size )
|
||||
{
|
||||
FT_ULong checksum = 0;
|
||||
FT_ULong aligned_size = size & ~3;
|
||||
FT_ULong aligned_size = size & ~3UL;
|
||||
FT_ULong i;
|
||||
FT_ULong v;
|
||||
|
||||
|
@ -317,7 +318,9 @@
|
|||
{
|
||||
#ifdef FT_CONFIG_OPTION_USE_BROTLI
|
||||
|
||||
FT_ULong uncompressed_size = dst_size;
|
||||
/* this cast is only of importance on 32bit systems; */
|
||||
/* we don't validate it */
|
||||
FT_Offset uncompressed_size = (FT_Offset)dst_size;
|
||||
BrotliDecoderResult result;
|
||||
|
||||
|
||||
|
@ -536,12 +539,12 @@
|
|||
FT_ULong* glyph_size )
|
||||
{
|
||||
FT_UInt flag_offset = 10 + ( 2 * n_contours ) + 2 + instruction_len;
|
||||
FT_Int last_flag = -1;
|
||||
FT_Int repeat_count = 0;
|
||||
FT_Int last_x = 0;
|
||||
FT_Int last_y = 0;
|
||||
FT_UInt x_bytes = 0;
|
||||
FT_UInt y_bytes = 0;
|
||||
FT_Byte last_flag = 0xFFU;
|
||||
FT_Byte repeat_count = 0;
|
||||
FT_Int last_x = 0;
|
||||
FT_Int last_y = 0;
|
||||
FT_UInt x_bytes = 0;
|
||||
FT_UInt y_bytes = 0;
|
||||
FT_UInt xy_bytes;
|
||||
FT_UInt i;
|
||||
FT_UInt x_offset;
|
||||
|
@ -553,9 +556,9 @@
|
|||
{
|
||||
const WOFF2_PointRec point = points[i];
|
||||
|
||||
FT_Int flag = point.on_curve ? GLYF_ON_CURVE : 0;
|
||||
FT_Int dx = point.x - last_x;
|
||||
FT_Int dy = point.y - last_y;
|
||||
FT_Byte flag = point.on_curve ? GLYF_ON_CURVE : 0;
|
||||
FT_Int dx = point.x - last_x;
|
||||
FT_Int dy = point.y - last_y;
|
||||
|
||||
|
||||
if ( dx == 0 )
|
||||
|
@ -632,7 +635,7 @@
|
|||
if ( dx == 0 )
|
||||
;
|
||||
else if ( dx > -256 && dx < 256 )
|
||||
dst[x_offset++] = FT_ABS( dx );
|
||||
dst[x_offset++] = (FT_Byte)FT_ABS( dx );
|
||||
else
|
||||
{
|
||||
pointer = dst + x_offset;
|
||||
|
@ -645,7 +648,7 @@
|
|||
if ( dy == 0 )
|
||||
;
|
||||
else if ( dy > -256 && dy < 256 )
|
||||
dst[y_offset++] = FT_ABS( dy );
|
||||
dst[y_offset++] = (FT_Byte)FT_ABS( dy );
|
||||
else
|
||||
{
|
||||
pointer = dst + y_offset;
|
||||
|
@ -917,7 +920,7 @@
|
|||
bbox_bitmap_offset = substreams[BBOX_STREAM].offset;
|
||||
|
||||
/* Size of bboxBitmap = 4 * floor((numGlyphs + 31) / 32) */
|
||||
bitmap_length = ( ( num_glyphs + 31 ) >> 5 ) << 2;
|
||||
bitmap_length = ( ( num_glyphs + 31U ) >> 5 ) << 2;
|
||||
substreams[BBOX_STREAM].offset += bitmap_length;
|
||||
|
||||
glyph_buf_size = WOFF2_DEFAULT_GLYPH_BUF;
|
||||
|
@ -1195,7 +1198,7 @@
|
|||
|
||||
/* Store x_mins, may be required to reconstruct `hmtx'. */
|
||||
if ( n_contours > 0 )
|
||||
info->x_mins[i] = x_min;
|
||||
info->x_mins[i] = (FT_Short)x_min;
|
||||
}
|
||||
|
||||
info->glyf_table->dst_length = dest_offset - info->glyf_table->dst_offset;
|
||||
|
@ -1219,7 +1222,7 @@
|
|||
FT_TRACE4(( " loca table info:\n" ));
|
||||
FT_TRACE4(( " dst_offset = %lu\n", info->loca_table->dst_offset ));
|
||||
FT_TRACE4(( " dst_length = %lu\n", info->loca_table->dst_length ));
|
||||
FT_TRACE4(( " checksum = %09x\n", *loca_checksum ));
|
||||
FT_TRACE4(( " checksum = %09lx\n", *loca_checksum ));
|
||||
|
||||
/* Set pointer `sfnt_bytes' to its correct value. */
|
||||
*sfnt_bytes = sfnt;
|
||||
|
@ -1343,7 +1346,7 @@
|
|||
if ( FT_STREAM_SEEK( glyf_offset ) || FT_STREAM_SKIP( 2 ) )
|
||||
return error;
|
||||
|
||||
if ( FT_READ_USHORT( info->x_mins[i] ) )
|
||||
if ( FT_READ_SHORT( info->x_mins[i] ) )
|
||||
return error;
|
||||
}
|
||||
|
||||
|
@ -1570,7 +1573,7 @@
|
|||
WOFF2_TableRec table = *( indices[nn] );
|
||||
|
||||
|
||||
FT_TRACE3(( "Seeking to %d with table size %d.\n",
|
||||
FT_TRACE3(( "Seeking to %ld with table size %ld.\n",
|
||||
table.src_offset, table.src_length ));
|
||||
FT_TRACE3(( "Table tag: %c%c%c%c.\n",
|
||||
(FT_Char)( table.Tag >> 24 ),
|
||||
|
@ -1611,7 +1614,7 @@
|
|||
|
||||
checksum = compute_ULong_sum( transformed_buf + table.src_offset,
|
||||
table.src_length );
|
||||
FT_TRACE4(( "Checksum = %09x.\n", checksum ));
|
||||
FT_TRACE4(( "Checksum = %09lx.\n", checksum ));
|
||||
|
||||
if ( WRITE_SFNT_BUF( transformed_buf + table.src_offset,
|
||||
table.src_length ) )
|
||||
|
@ -1636,7 +1639,7 @@
|
|||
memory ) )
|
||||
goto Fail;
|
||||
|
||||
FT_TRACE4(( "Checksum = %09x.\n", checksum ));
|
||||
FT_TRACE4(( "Checksum = %09lx.\n", checksum ));
|
||||
}
|
||||
|
||||
else if ( table.Tag == TTAG_loca )
|
||||
|
@ -1712,7 +1715,7 @@
|
|||
|
||||
WRITE_ULONG( buf_cursor, font_checksum );
|
||||
|
||||
FT_TRACE2(( "Final checksum = %09x.\n", font_checksum ));
|
||||
FT_TRACE2(( "Final checksum = %09lx.\n", font_checksum ));
|
||||
|
||||
woff2->actual_sfnt_size = dest_offset;
|
||||
|
||||
|
@ -1809,15 +1812,15 @@
|
|||
if ( FT_STREAM_READ_FIELDS( woff2_header_fields, &woff2 ) )
|
||||
return error;
|
||||
|
||||
FT_TRACE4(( "signature -> 0x%X\n", woff2.signature ));
|
||||
FT_TRACE4(( "signature -> 0x%lX\n", woff2.signature ));
|
||||
FT_TRACE2(( "flavor -> 0x%08lx\n", woff2.flavor ));
|
||||
FT_TRACE4(( "length -> %lu\n", woff2.length ));
|
||||
FT_TRACE2(( "num_tables -> %hu\n", woff2.num_tables ));
|
||||
FT_TRACE4(( "totalSfntSize -> %lu\n", woff2.totalSfntSize ));
|
||||
FT_TRACE4(( "metaOffset -> %hu\n", woff2.metaOffset ));
|
||||
FT_TRACE4(( "metaLength -> %hu\n", woff2.metaLength ));
|
||||
FT_TRACE4(( "privOffset -> %hu\n", woff2.privOffset ));
|
||||
FT_TRACE4(( "privLength -> %hu\n", woff2.privLength ));
|
||||
FT_TRACE4(( "metaOffset -> %lu\n", woff2.metaOffset ));
|
||||
FT_TRACE4(( "metaLength -> %lu\n", woff2.metaLength ));
|
||||
FT_TRACE4(( "privOffset -> %lu\n", woff2.privOffset ));
|
||||
FT_TRACE4(( "privLength -> %lu\n", woff2.privLength ));
|
||||
|
||||
/* Make sure we don't recurse back here. */
|
||||
if ( woff2.flavor == TTAG_wOF2 )
|
||||
|
@ -1849,9 +1852,11 @@
|
|||
FT_NEW_ARRAY( indices, woff2.num_tables ) )
|
||||
goto Exit;
|
||||
|
||||
FT_TRACE2(( "\n"
|
||||
" tag flags transform origLen transformLen\n"
|
||||
" --------------------------------------------------\n" ));
|
||||
FT_TRACE2((
|
||||
"\n"
|
||||
" tag flags transform origLen transformLen offset\n"
|
||||
" -----------------------------------------------------------\n" ));
|
||||
/* " XXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX" */
|
||||
|
||||
for ( nn = 0; nn < woff2.num_tables; nn++ )
|
||||
{
|
||||
|
@ -1921,7 +1926,7 @@
|
|||
src_offset += table->TransformLength;
|
||||
table->flags = flags;
|
||||
|
||||
FT_TRACE2(( " %c%c%c%c %08d %08d %08ld %08ld\n",
|
||||
FT_TRACE2(( " %c%c%c%c %08d %08d %08ld %08ld %08ld\n",
|
||||
(FT_Char)( table->Tag >> 24 ),
|
||||
(FT_Char)( table->Tag >> 16 ),
|
||||
(FT_Char)( table->Tag >> 8 ),
|
||||
|
@ -1930,7 +1935,6 @@
|
|||
( table->FlagByte >> 6 ) & 0x03,
|
||||
table->dst_length,
|
||||
table->TransformLength,
|
||||
table->src_length,
|
||||
table->src_offset ));
|
||||
|
||||
indices[nn] = table;
|
||||
|
@ -1976,7 +1980,7 @@
|
|||
goto Exit;
|
||||
}
|
||||
|
||||
FT_TRACE4(( "Number of fonts in TTC: %ld\n", woff2.num_fonts ));
|
||||
FT_TRACE4(( "Number of fonts in TTC: %d\n", woff2.num_fonts ));
|
||||
|
||||
if ( FT_NEW_ARRAY( woff2.ttc_fonts, woff2.num_fonts ) )
|
||||
goto Exit;
|
||||
|
@ -1994,7 +1998,7 @@
|
|||
if ( FT_NEW_ARRAY( ttc_font->table_indices, ttc_font->num_tables ) )
|
||||
goto Exit;
|
||||
|
||||
FT_TRACE5(( "Number of tables in font %d: %ld\n",
|
||||
FT_TRACE5(( "Number of tables in font %d: %d\n",
|
||||
nn, ttc_font->num_tables ));
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
|
|
|
@ -3751,6 +3751,7 @@
|
|||
|
||||
static const TT_CMap_Class tt_cmap_classes[] =
|
||||
{
|
||||
#undef TTCMAPCITEM
|
||||
#define TTCMAPCITEM( a ) &a,
|
||||
#include "ttcmapc.h"
|
||||
NULL,
|
||||
|
|
|
@ -90,6 +90,11 @@ FT_BEGIN_HEADER
|
|||
};
|
||||
|
||||
|
||||
#undef TTCMAPCITEM
|
||||
#define TTCMAPCITEM( a ) FT_CALLBACK_TABLE const TT_CMap_ClassRec a;
|
||||
#include "ttcmapc.h"
|
||||
|
||||
|
||||
typedef struct TT_ValidatorRec_
|
||||
{
|
||||
FT_ValidatorRec validator;
|
||||
|
|
|
@ -64,8 +64,8 @@
|
|||
#endif
|
||||
|
||||
|
||||
FT_TRACE4(( "tt_face_lookup_table: %08p, `%c%c%c%c' -- ",
|
||||
face,
|
||||
FT_TRACE4(( "tt_face_lookup_table: %p, `%c%c%c%c' -- ",
|
||||
(void *)face,
|
||||
(FT_Char)( tag >> 24 ),
|
||||
(FT_Char)( tag >> 16 ),
|
||||
(FT_Char)( tag >> 8 ),
|
||||
|
@ -362,7 +362,7 @@
|
|||
};
|
||||
|
||||
|
||||
FT_TRACE2(( "tt_face_load_font_dir: %08p\n", face ));
|
||||
FT_TRACE2(( "tt_face_load_font_dir: %p\n", (void *)face ));
|
||||
|
||||
/* read the offset table */
|
||||
|
||||
|
@ -416,9 +416,8 @@
|
|||
FT_FRAME_ENTER( sfnt.num_tables * 16L ) )
|
||||
goto Exit;
|
||||
|
||||
FT_TRACE2(( "\n"
|
||||
" tag offset length checksum\n"
|
||||
" ----------------------------------\n" ));
|
||||
FT_TRACE2(( " tag offset length checksum\n" ));
|
||||
FT_TRACE2(( " ----------------------------------\n" ));
|
||||
|
||||
valid_entries = 0;
|
||||
for ( nn = 0; nn < sfnt.num_tables; nn++ )
|
||||
|
@ -1314,7 +1313,7 @@
|
|||
/* we don't load the glyph names, we do that in another */
|
||||
/* module (ttpost). */
|
||||
|
||||
FT_TRACE3(( "FormatType: 0x%x\n", post->FormatType ));
|
||||
FT_TRACE3(( "FormatType: 0x%lx\n", post->FormatType ));
|
||||
FT_TRACE3(( "isFixedPitch: %s\n", post->isFixedPitch
|
||||
? " yes" : " no" ));
|
||||
|
||||
|
|
|
@ -239,7 +239,7 @@
|
|||
break;
|
||||
else
|
||||
{
|
||||
FT_TRACE6(( "load_format_20: %d byte left in post table\n",
|
||||
FT_TRACE6(( "load_format_20: %ld byte left in post table\n",
|
||||
post_limit - FT_STREAM_POS() ));
|
||||
|
||||
if ( FT_READ_BYTE( len ) )
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue