freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype][update-cmake-dep-finders] 4 commits: [sfnt] Add


From: Nikolaus Waxweiler (@madig)
Subject: [Git][freetype/freetype][update-cmake-dep-finders] 4 commits: [sfnt] Additional guards on the POST table.
Date: Wed, 19 May 2021 20:55:07 +0000

Nikolaus Waxweiler pushed to branch update-cmake-dep-finders at FreeType / FreeType

Commits:

10 changed files:

Changes:

  • CMakeLists.txt
    ... ... @@ -103,6 +103,9 @@ if (NOT CMAKE_VERSION VERSION_LESS 3.3)
    103 103
       # Allow symbol visibility settings also on static libraries. CMake < 3.3
    
    104 104
       # only sets the property on a shared library build.
    
    105 105
       cmake_policy(SET CMP0063 NEW)
    
    106
    +
    
    107
    +  # Support new IN_LIST if() operator.
    
    108
    +  cmake_policy(SET CMP0057 NEW)
    
    106 109
     endif ()
    
    107 110
     
    
    108 111
     include(CheckIncludeFile)
    
    ... ... @@ -461,9 +464,9 @@ if (PNG_FOUND)
    461 464
       target_include_directories(freetype PRIVATE ${PNG_INCLUDE_DIRS})
    
    462 465
       list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "libpng")
    
    463 466
     endif ()
    
    464
    -if (HARFBUZZ_FOUND)
    
    465
    -  target_link_libraries(freetype PRIVATE ${HARFBUZZ_LIBRARIES})
    
    466
    -  target_include_directories(freetype PRIVATE ${HARFBUZZ_INCLUDE_DIRS})
    
    467
    +if (HarfBuzz_FOUND)
    
    468
    +  target_link_libraries(freetype PRIVATE ${HarfBuzz_LIBRARY})
    
    469
    +  target_include_directories(freetype PRIVATE ${HarfBuzz_INCLUDE_DIRS})
    
    467 470
       list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "harfbuzz >= ${HARFBUZZ_MIN_VERSION}")
    
    468 471
     endif ()
    
    469 472
     if (BROTLIDEC_FOUND)
    

  • ChangeLog
    1
    +2021-05-19  Nikolaus Waxweiler  <madigens@gmail.com>
    
    2
    +
    
    3
    +	[CMake] Update dependency finders.
    
    4
    +
    
    5
    +	1. Fixes CMake using any found HarfBuzz version lower than the minimum
    
    6
    +	required. This is based on HALX99's merge request at
    
    7
    +	https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/31
    
    8
    +	2. Update FindHarfBuzz.cmake from
    
    9
    +	https://github.com/WebKit/WebKit/blob/1ce32454/Source/cmake/FindHarfBuzz.cmake
    
    10
    +	and guard post-CMake-3.1 features to keep the minimum version unchanged
    
    11
    +	3. Update FindBrotliDec.cmake to stop the warnings, based on what
    
    12
    +	https://github.com/google/woff2/blob/a0d0ed7d/cmake/FindBrotliDec.cmake
    
    13
    +	is doing
    
    14
    +
    
    15
    +	* CMakeLists.txt, builds/cmake/FindHarfBuzz.cmake: Implement 1 and 2.
    
    16
    +	* builds/cmake/FindBrotliDec.cmake: Implement 3.
    
    17
    +
    
    18
    +2021-05-19  Ben Wagner  <bungeman@chromium.org>
    
    19
    +
    
    20
    +	[gzip] Use exact type for `ft_gzip_alloc` and `ft_gzip_free`.
    
    21
    +
    
    22
    +	While a function pointer may be cast to another function pointer
    
    23
    +	type, it is required to cast the function pointer back to the
    
    24
    +	original function pointer type before calling it.  If a parameter is
    
    25
    +	a pointer the exact pointer type is required.  Using a pointer to a
    
    26
    +	different underlying type is technically undefined behavior.  The
    
    27
    +	wrapper functions `ft_gzip_alloc` and `ft_gzip_free` took
    
    28
    +	`FT_Memory` (a `FT_MemoryRec_*`) instead of `voidpf` (`void*`), so
    
    29
    +	when gzip calls these callbacks through `alloc_func` or `free_func`
    
    30
    +	it invokes undefined behavior.  On most platforms this works out as
    
    31
    +	expected, but newer undefined behavior detectors and targets like
    
    32
    +	wasm can detect this and will produce an error.
    
    33
    +
    
    34
    +	* src/gzip/ftgzip.c (ft_gzip_alloc, ft_gzip_free): Update signatures
    
    35
    +	to exactly match `alloc_func` and `free_func`, respectively.
    
    36
    +	Internally, cast the `void*` opaque pointer to `FT_Memory`.
    
    37
    +
    
    38
    +2021-05-18  Alexei Podtelezhnikov  <apodtele@gmail.com>
    
    39
    +
    
    40
    +	Prioritize the anti-aliasing renderer module.
    
    41
    +
    
    42
    +	* modules.cfg: Reorder the renderers.
    
    43
    +	* include/freetype/config/ftmodule.h: Ditto.
    
    44
    +
    
    45
    +2021-05-16  Alexei Podtelezhnikov  <apodtele@gmail.com>
    
    46
    +
    
    47
    +	[sfnt] Additional guards on the POST table.
    
    48
    +
    
    49
    +	Fixes timeout (#1055) analyzed by Ben Wagner, reported as
    
    50
    +
    
    51
    +	  https://crbug.com/1194092
    
    52
    +
    
    53
    +	* src/sfnt/ttload.c (tt_face_load_post): Check POST format.
    
    54
    +	* src/sfnt/sfobjs.c (sfnt_load_face): Synthesize the missing unicode
    
    55
    +	charmap only if the glyph names exist.
    
    56
    +	* src/psnames/psmodule.c (ps_unicode_value): Short cut ".notdef" and
    
    57
    +	".null".
    
    58
    +
    
    1 59
     2021-05-13  Daniel McArdle  <dmcardle@chromium.org>
    
    2 60
     
    
    3 61
     	[psaux] Use doubling allocation strategy for CF2_ArrStack.
    

  • builds/cmake/FindBrotliDec.cmake
    ... ... @@ -19,7 +19,8 @@
    19 19
     #   BROTLIDEC_INCLUDE_DIRS
    
    20 20
     #   BROTLIDEC_LIBRARIES
    
    21 21
     
    
    22
    -include(FindPkgConfig)
    
    22
    +find_package(PkgConfig QUIET)
    
    23
    +
    
    23 24
     pkg_check_modules(PC_BROTLIDEC QUIET libbrotlidec)
    
    24 25
     
    
    25 26
     if (PC_BROTLIDEC_VERSION)
    
    ... ... @@ -41,7 +42,7 @@ find_library(BROTLIDEC_LIBRARIES
    41 42
     
    
    42 43
     include(FindPackageHandleStandardArgs)
    
    43 44
     find_package_handle_standard_args(
    
    44
    -  brotlidec
    
    45
    +  BrotliDec
    
    45 46
       REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLIDEC_LIBRARIES
    
    46 47
       FOUND_VAR BROTLIDEC_FOUND
    
    47 48
       VERSION_VAR BROTLIDEC_VERSION)
    

  • builds/cmake/FindHarfBuzz.cmake
    1 1
     # Copyright (c) 2012, Intel Corporation
    
    2
    +# Copyright (c) 2019 Sony Interactive Entertainment Inc.
    
    2 3
     #
    
    3 4
     # Redistribution and use in source and binary forms, with or without
    
    4 5
     # modification, are permitted provided that the following conditions are met:
    
    ... ... @@ -23,65 +24,180 @@
    23 24
     # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    
    24 25
     # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    
    25 26
     # POSSIBILITY OF SUCH DAMAGE.
    
    26
    -
    
    27
    -
    
    28
    -# Try to find HarfBuzz include and library directories.
    
    29 27
     #
    
    30
    -# After successful discovery, this will set for inclusion where needed:
    
    28
    +# Try to find Harfbuzz include and library directories.
    
    31 29
     #
    
    32
    -#   HARFBUZZ_INCLUDE_DIRS - containg the HarfBuzz headers
    
    33
    -#   HARFBUZZ_LIBRARIES    - containg the HarfBuzz library
    
    30
    +# After successful discovery, this will set for inclusion where needed:
    
    31
    +# HarfBuzz_INCLUDE_DIRS - containg the HarfBuzz headers
    
    32
    +# HarfBuzz_LIBRARIES - containg the HarfBuzz library
    
    33
    +
    
    34
    +#[=======================================================================[.rst:
    
    35
    +FindHarfBuzz
    
    36
    +--------------
    
    37
    +
    
    38
    +Find HarfBuzz headers and libraries.
    
    39
    +
    
    40
    +Imported Targets
    
    41
    +^^^^^^^^^^^^^^^^
    
    42
    +
    
    43
    +``HarfBuzz::HarfBuzz``
    
    44
    +  The HarfBuzz library, if found.
    
    45
    +
    
    46
    +``HarfBuzz::ICU``
    
    47
    +  The HarfBuzz ICU library, if found.
    
    34 48
     
    
    35
    -include(FindPkgConfig)
    
    49
    +Result Variables
    
    50
    +^^^^^^^^^^^^^^^^
    
    51
    +
    
    52
    +This will define the following variables in your project:
    
    53
    +
    
    54
    +``HarfBuzz_FOUND``
    
    55
    +  true if (the requested version of) HarfBuzz is available.
    
    56
    +``HarfBuzz_VERSION``
    
    57
    +  the version of HarfBuzz.
    
    58
    +``HarfBuzz_LIBRARIES``
    
    59
    +  the libraries to link against to use HarfBuzz.
    
    60
    +``HarfBuzz_INCLUDE_DIRS``
    
    61
    +  where to find the HarfBuzz headers.
    
    62
    +``HarfBuzz_COMPILE_OPTIONS``
    
    63
    +  this should be passed to target_compile_options(), if the
    
    64
    +  target is not used for linking
    
    65
    +
    
    66
    +#]=======================================================================]
    
    67
    +
    
    68
    +find_package(PkgConfig QUIET)
    
    36 69
     pkg_check_modules(PC_HARFBUZZ QUIET harfbuzz)
    
    70
    +set(HarfBuzz_COMPILE_OPTIONS ${PC_HARFBUZZ_CFLAGS_OTHER})
    
    71
    +set(HarfBuzz_VERSION ${PC_HARFBUZZ_CFLAGS_VERSION})
    
    72
    +
    
    73
    +find_path(HarfBuzz_INCLUDE_DIR
    
    74
    +    NAMES hb.h
    
    75
    +    HINTS ${PC_HARFBUZZ_INCLUDEDIR} ${PC_HARFBUZZ_INCLUDE_DIRS}
    
    76
    +    PATH_SUFFIXES harfbuzz
    
    77
    +)
    
    78
    +
    
    79
    +find_library(HarfBuzz_LIBRARY
    
    80
    +    NAMES ${HarfBuzz_NAMES} harfbuzz
    
    81
    +    HINTS ${PC_HARFBUZZ_LIBDIR} ${PC_HARFBUZZ_LIBRARY_DIRS}
    
    82
    +)
    
    83
    +
    
    84
    +if (HarfBuzz_INCLUDE_DIR AND NOT HarfBuzz_VERSION)
    
    85
    +    if (EXISTS "${HarfBuzz_INCLUDE_DIR}/hb-version.h")
    
    86
    +        file(READ "${HarfBuzz_INCLUDE_DIR}/hb-version.h" _harfbuzz_version_content)
    
    87
    +
    
    88
    +        string(REGEX MATCH "#define +HB_VERSION_STRING +\"([0-9]+\\.[0-9]+\\.[0-9]+)\"" _dummy "${_harfbuzz_version_content}")
    
    89
    +        set(HarfBuzz_VERSION "${CMAKE_MATCH_1}")
    
    90
    +    endif ()
    
    91
    +endif ()
    
    37 92
     
    
    38
    -find_path(HARFBUZZ_INCLUDE_DIRS
    
    39
    -  NAMES hb.h
    
    40
    -  HINTS ${PC_HARFBUZZ_INCLUDEDIR}
    
    41
    -        ${PC_HARFBUZZ_INCLUDE_DIRS}
    
    42
    -  PATH_SUFFIXES harfbuzz)
    
    43
    -
    
    44
    -find_library(HARFBUZZ_LIBRARIES
    
    45
    -  NAMES harfbuzz
    
    46
    -  HINTS ${PC_HARFBUZZ_LIBDIR}
    
    47
    -        ${PC_HARFBUZZ_LIBRARY_DIRS})
    
    48
    -
    
    49
    -if (HARFBUZZ_INCLUDE_DIRS)
    
    50
    -  if (EXISTS "${HARFBUZZ_INCLUDE_DIRS}/hb-version.h")
    
    51
    -    file(READ "${HARFBUZZ_INCLUDE_DIRS}/hb-version.h" _harfbuzz_version_content)
    
    52
    -
    
    53
    -    string(REGEX MATCH
    
    54
    -           "#define +HB_VERSION_STRING +\"([0-9]+\\.[0-9]+\\.[0-9]+)\""
    
    55
    -           _dummy "${_harfbuzz_version_content}")
    
    56
    -    set(HARFBUZZ_VERSION "${CMAKE_MATCH_1}")
    
    93
    +if ("${HarfBuzz_FIND_VERSION}" VERSION_GREATER "${HarfBuzz_VERSION}")
    
    94
    +  if (HarfBuzz_FIND_REQUIRED)
    
    95
    +    message(FATAL_ERROR
    
    96
    +      "Required version (" ${HarfBuzz_FIND_VERSION} ")"
    
    97
    +      " is higher than found version (" ${HarfBuzz_VERSION} ")")
    
    98
    +  else ()
    
    99
    +    message(WARNING
    
    100
    +      "Required version (" ${HarfBuzz_FIND_VERSION} ")"
    
    101
    +      " is higher than found version (" ${HarfBuzz_VERSION} ")")
    
    102
    +    unset(HarfBuzz_VERSION)
    
    103
    +    unset(HarfBuzz_INCLUDE_DIRS)
    
    104
    +    unset(HarfBuzz_LIBRARIES)
    
    105
    +    return ()
    
    57 106
       endif ()
    
    58 107
     endif ()
    
    59 108
     
    
    60
    -if ("${harfbuzz_FIND_VERSION}" VERSION_GREATER "${HARFBUZZ_VERSION}")
    
    61
    -  message(FATAL_ERROR
    
    62
    -    "Required version (" ${harfbuzz_FIND_VERSION} ")"
    
    63
    -    " is higher than found version (" ${HARFBUZZ_VERSION} ")")
    
    109
    +# Find components
    
    110
    +if (HarfBuzz_INCLUDE_DIR AND HarfBuzz_LIBRARY)
    
    111
    +    set(_HarfBuzz_REQUIRED_LIBS_FOUND ON)
    
    112
    +    set(HarfBuzz_LIBS_FOUND "HarfBuzz (required): ${HarfBuzz_LIBRARY}")
    
    113
    +else ()
    
    114
    +    set(_HarfBuzz_REQUIRED_LIBS_FOUND OFF)
    
    115
    +    set(HarfBuzz_LIBS_NOT_FOUND "HarfBuzz (required)")
    
    64 116
     endif ()
    
    65 117
     
    
    66
    -include(FindPackageHandleStandardArgs)
    
    67
    -find_package_handle_standard_args(
    
    68
    -  harfbuzz
    
    69
    -  REQUIRED_VARS HARFBUZZ_INCLUDE_DIRS HARFBUZZ_LIBRARIES
    
    70
    -  VERSION_VAR HARFBUZZ_VERSION)
    
    118
    +if (NOT CMAKE_VERSION VERSION_LESS 3.3)
    
    119
    +  if ("ICU" IN_LIST HarfBuzz_FIND_COMPONENTS)
    
    120
    +      pkg_check_modules(PC_HARFBUZZ_ICU QUIET harfbuzz-icu)
    
    121
    +      set(HarfBuzz_ICU_COMPILE_OPTIONS ${PC_HARFBUZZ_ICU_CFLAGS_OTHER})
    
    71 122
     
    
    72
    -mark_as_advanced(
    
    73
    -  HARFBUZZ_INCLUDE_DIRS
    
    74
    -  HARFBUZZ_LIBRARIES)
    
    123
    +      find_path(HarfBuzz_ICU_INCLUDE_DIR
    
    124
    +          NAMES hb-icu.h
    
    125
    +          HINTS ${PC_HARFBUZZ_ICU_INCLUDEDIR} ${PC_HARFBUZZ_ICU_INCLUDE_DIRS}
    
    126
    +          PATH_SUFFIXES harfbuzz
    
    127
    +      )
    
    128
    +
    
    129
    +      find_library(HarfBuzz_ICU_LIBRARY
    
    130
    +          NAMES ${HarfBuzz_ICU_NAMES} harfbuzz-icu
    
    131
    +          HINTS ${PC_HARFBUZZ_ICU_LIBDIR} ${PC_HARFBUZZ_ICU_LIBRARY_DIRS}
    
    132
    +      )
    
    133
    +
    
    134
    +      if (HarfBuzz_ICU_LIBRARY)
    
    135
    +          if (HarfBuzz_FIND_REQUIRED_ICU)
    
    136
    +              list(APPEND HarfBuzz_LIBS_FOUND "ICU (required): ${HarfBuzz_ICU_LIBRARY}")
    
    137
    +          else ()
    
    138
    +            list(APPEND HarfBuzz_LIBS_FOUND "ICU (optional): ${HarfBuzz_ICU_LIBRARY}")
    
    139
    +          endif ()
    
    140
    +      else ()
    
    141
    +          if (HarfBuzz_FIND_REQUIRED_ICU)
    
    142
    +            set(_HarfBuzz_REQUIRED_LIBS_FOUND OFF)
    
    143
    +            list(APPEND HarfBuzz_LIBS_NOT_FOUND "ICU (required)")
    
    144
    +          else ()
    
    145
    +            list(APPEND HarfBuzz_LIBS_NOT_FOUND "ICU (optional)")
    
    146
    +          endif ()
    
    147
    +      endif ()
    
    148
    +  endif ()
    
    149
    +endif ()
    
    150
    +
    
    151
    +if (NOT HarfBuzz_FIND_QUIETLY)
    
    152
    +    if (HarfBuzz_LIBS_FOUND)
    
    153
    +        message(STATUS "Found the following HarfBuzz libraries:")
    
    154
    +        foreach (found ${HarfBuzz_LIBS_FOUND})
    
    155
    +            message(STATUS " ${found}")
    
    156
    +        endforeach ()
    
    157
    +    endif ()
    
    158
    +    if (HarfBuzz_LIBS_NOT_FOUND)
    
    159
    +        message(STATUS "The following HarfBuzz libraries were not found:")
    
    160
    +        foreach (found ${HarfBuzz_LIBS_NOT_FOUND})
    
    161
    +            message(STATUS " ${found}")
    
    162
    +        endforeach ()
    
    163
    +    endif ()
    
    164
    +endif ()
    
    165
    +
    
    166
    +include(FindPackageHandleStandardArgs)
    
    167
    +find_package_handle_standard_args(HarfBuzz
    
    168
    +    FOUND_VAR HarfBuzz_FOUND
    
    169
    +    REQUIRED_VARS HarfBuzz_INCLUDE_DIR HarfBuzz_LIBRARY _HarfBuzz_REQUIRED_LIBS_FOUND
    
    170
    +    VERSION_VAR HarfBuzz_VERSION
    
    171
    +)
    
    75 172
     
    
    76
    -# Allow easy linking as in
    
    77
    -#
    
    78
    -#   target_link_libraries(freetype PRIVATE Harfbuzz::Harfbuzz)
    
    79
    -#
    
    80 173
     if (NOT CMAKE_VERSION VERSION_LESS 3.1)
    
    81
    -  if (HARFBUZZ_FOUND AND NOT TARGET Harfbuzz::Harfbuzz)
    
    82
    -    add_library(Harfbuzz::Harfbuzz INTERFACE IMPORTED)
    
    83
    -    set_target_properties(
    
    84
    -        Harfbuzz::Harfbuzz PROPERTIES
    
    85
    -          INTERFACE_INCLUDE_DIRECTORIES "${HARFBUZZ_INCLUDE_DIRS}")
    
    174
    +  if (HarfBuzz_LIBRARY AND NOT TARGET HarfBuzz::HarfBuzz)
    
    175
    +      add_library(HarfBuzz::HarfBuzz UNKNOWN IMPORTED GLOBAL)
    
    176
    +      set_target_properties(HarfBuzz::HarfBuzz PROPERTIES
    
    177
    +          IMPORTED_LOCATION "${HarfBuzz_LIBRARY}"
    
    178
    +          INTERFACE_COMPILE_OPTIONS "${HarfBuzz_COMPILE_OPTIONS}"
    
    179
    +          INTERFACE_INCLUDE_DIRECTORIES "${HarfBuzz_INCLUDE_DIR}"
    
    180
    +      )
    
    181
    +  endif ()
    
    182
    +
    
    183
    +  if (HarfBuzz_ICU_LIBRARY AND NOT TARGET HarfBuzz::ICU)
    
    184
    +      add_library(HarfBuzz::ICU UNKNOWN IMPORTED GLOBAL)
    
    185
    +      set_target_properties(HarfBuzz::ICU PROPERTIES
    
    186
    +          IMPORTED_LOCATION "${HarfBuzz_ICU_LIBRARY}"
    
    187
    +          INTERFACE_COMPILE_OPTIONS "${HarfBuzz_ICU_COMPILE_OPTIONS}"
    
    188
    +          INTERFACE_INCLUDE_DIRECTORIES "${HarfBuzz_ICU_INCLUDE_DIR}"
    
    189
    +      )
    
    86 190
       endif ()
    
    87 191
     endif ()
    
    192
    +
    
    193
    +mark_as_advanced(
    
    194
    +    HarfBuzz_INCLUDE_DIR
    
    195
    +    HarfBuzz_ICU_INCLUDE_DIR
    
    196
    +    HarfBuzz_LIBRARY
    
    197
    +    HarfBuzz_ICU_LIBRARY
    
    198
    +)
    
    199
    +
    
    200
    +if (HarfBuzz_FOUND)
    
    201
    +   set(HarfBuzz_LIBRARIES ${HarfBuzz_LIBRARY} ${HarfBuzz_ICU_LIBRARY})
    
    202
    +   set(HarfBuzz_INCLUDE_DIRS ${HarfBuzz_INCLUDE_DIR} ${HarfBuzz_ICU_INCLUDE_DIR})
    
    203
    +endif ()

  • include/freetype/config/ftmodule.h
    ... ... @@ -19,13 +19,13 @@ FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )
    19 19
     FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )
    
    20 20
     FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )
    
    21 21
     FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )
    
    22
    +FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
    
    22 23
     FT_USE_MODULE( FT_Module_Class, psaux_module_class )
    
    23 24
     FT_USE_MODULE( FT_Module_Class, psnames_module_class )
    
    24 25
     FT_USE_MODULE( FT_Module_Class, pshinter_module_class )
    
    25
    -FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
    
    26 26
     FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
    
    27 27
     FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
    
    28
    -FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
    
    28
    +FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
    
    29 29
     FT_USE_MODULE( FT_Renderer_Class, ft_sdf_renderer_class )
    
    30 30
     FT_USE_MODULE( FT_Renderer_Class, ft_bitmap_sdf_renderer_class )
    
    31 31
     
    

  • modules.cfg
    ... ... @@ -93,12 +93,12 @@ HINTING_MODULES += pshinter
    93 93
     #### raster modules -- at least one is required for vector font formats
    
    94 94
     ####
    
    95 95
     
    
    96
    -# Monochrome rasterizer.
    
    97
    -RASTER_MODULES += raster
    
    98
    -
    
    99 96
     # Anti-aliasing rasterizer.
    
    100 97
     RASTER_MODULES += smooth
    
    101 98
     
    
    99
    +# Monochrome rasterizer.
    
    100
    +RASTER_MODULES += raster
    
    101
    +
    
    102 102
     # Signed distance field rasterizer.
    
    103 103
     RASTER_MODULES += sdf
    
    104 104
     
    

  • src/gzip/ftgzip.c
    ... ... @@ -121,13 +121,14 @@
    121 121
          'malloc/free' */
    
    122 122
     
    
    123 123
       static voidpf
    
    124
    -  ft_gzip_alloc( FT_Memory  memory,
    
    125
    -                 uInt       items,
    
    126
    -                 uInt       size )
    
    124
    +  ft_gzip_alloc( voidpf  opaque,
    
    125
    +                 uInt    items,
    
    126
    +                 uInt    size )
    
    127 127
       {
    
    128
    -    FT_ULong    sz = (FT_ULong)size * items;
    
    128
    +    FT_Memory   memory = (FT_Memory)opaque;
    
    129
    +    FT_ULong    sz     = (FT_ULong)size * items;
    
    129 130
         FT_Error    error;
    
    130
    -    FT_Pointer  p  = NULL;
    
    131
    +    FT_Pointer  p      = NULL;
    
    131 132
     
    
    132 133
     
    
    133 134
         /* allocate and zero out */
    
    ... ... @@ -137,9 +138,12 @@
    137 138
     
    
    138 139
     
    
    139 140
       static void
    
    140
    -  ft_gzip_free( FT_Memory  memory,
    
    141
    -                voidpf     address )
    
    141
    +  ft_gzip_free( voidpf  opaque,
    
    142
    +                voidpf  address )
    
    142 143
       {
    
    144
    +    FT_Memory  memory = (FT_Memory)opaque;
    
    145
    +
    
    146
    +
    
    143 147
         FT_MEM_FREE( address );
    
    144 148
       }
    
    145 149
     
    
    ... ... @@ -151,14 +155,14 @@
    151 155
                 unsigned  items,
    
    152 156
                 unsigned  size )
    
    153 157
       {
    
    154
    -    return ft_gzip_alloc( (FT_Memory)opaque, items, size );
    
    158
    +    return ft_gzip_alloc( opaque, items, size );
    
    155 159
       }
    
    156 160
     
    
    157 161
       local void
    
    158 162
       zcfree( voidpf  opaque,
    
    159 163
               voidpf  ptr )
    
    160 164
       {
    
    161
    -    ft_gzip_free( (FT_Memory)opaque, ptr );
    
    165
    +    ft_gzip_free( opaque, ptr );
    
    162 166
       }
    
    163 167
     
    
    164 168
     #endif /* !SYSTEM_ZLIB && !USE_ZLIB_ZCALLOC */
    
    ... ... @@ -305,8 +309,8 @@
    305 309
         }
    
    306 310
     
    
    307 311
         /* initialize zlib -- there is no zlib header in the compressed stream */
    
    308
    -    zstream->zalloc = (alloc_func)ft_gzip_alloc;
    
    309
    -    zstream->zfree  = (free_func) ft_gzip_free;
    
    312
    +    zstream->zalloc = ft_gzip_alloc;
    
    313
    +    zstream->zfree  = ft_gzip_free;
    
    310 314
         zstream->opaque = stream->memory;
    
    311 315
     
    
    312 316
         zstream->avail_in = 0;
    
    ... ... @@ -742,8 +746,8 @@
    742 746
         stream.next_out  = output;
    
    743 747
         stream.avail_out = (uInt)*output_len;
    
    744 748
     
    
    745
    -    stream.zalloc = (alloc_func)ft_gzip_alloc;
    
    746
    -    stream.zfree  = (free_func) ft_gzip_free;
    
    749
    +    stream.zalloc = ft_gzip_alloc;
    
    750
    +    stream.zfree  = ft_gzip_free;
    
    747 751
         stream.opaque = memory;
    
    748 752
     
    
    749 753
         /* This is a temporary fix and will be removed once the internal
    

  • src/psnames/psmodule.c
    ... ... @@ -155,25 +155,24 @@
    155 155
         /* Look for a non-initial dot in the glyph name in order to */
    
    156 156
         /* find variants like `A.swash', `e.final', etc.            */
    
    157 157
         {
    
    158
    -      const char*  p   = glyph_name;
    
    159
    -      const char*  dot = NULL;
    
    158
    +      FT_UInt32    value = 0;
    
    159
    +      const char*  p     = glyph_name;
    
    160
    +
    
    160 161
     
    
    162
    +      for ( ; *p && *p != '.'; p++ )
    
    163
    +        ;
    
    161 164
     
    
    162
    -      for ( ; *p; p++ )
    
    165
    +      /* now look up the glyph in the Adobe Glyph List;      */
    
    166
    +      /* `.notdef', `.null' and the empty name are short cut */
    
    167
    +      if ( p > glyph_name )
    
    163 168
           {
    
    164
    -        if ( *p == '.' && p > glyph_name )
    
    165
    -        {
    
    166
    -          dot = p;
    
    167
    -          break;
    
    168
    -        }
    
    169
    +        value =  (FT_UInt32)ft_get_adobe_glyph_index( glyph_name, p );
    
    170
    +
    
    171
    +        if ( *p == '.' )
    
    172
    +          value |= (FT_UInt32)VARIANT_BIT;
    
    169 173
           }
    
    170 174
     
    
    171
    -      /* now look up the glyph in the Adobe Glyph List */
    
    172
    -      if ( !dot )
    
    173
    -        return (FT_UInt32)ft_get_adobe_glyph_index( glyph_name, p );
    
    174
    -      else
    
    175
    -        return (FT_UInt32)( ft_get_adobe_glyph_index( glyph_name, dot ) |
    
    176
    -                            VARIANT_BIT );
    
    175
    +      return value;
    
    177 176
         }
    
    178 177
       }
    
    179 178
     
    

  • src/sfnt/sfobjs.c
    ... ... @@ -1150,9 +1150,10 @@
    1150 1150
             }
    
    1151 1151
     
    
    1152 1152
             /* synthesize Unicode charmap if one is missing */
    
    1153
    -        if ( !has_unicode )
    
    1153
    +        if ( !has_unicode                                &&
    
    1154
    +             root->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
    
    1154 1155
             {
    
    1155
    -          FT_CharMapRec cmaprec;
    
    1156
    +          FT_CharMapRec  cmaprec;
    
    1156 1157
     
    
    1157 1158
     
    
    1158 1159
               cmaprec.face        = root;
    

  • src/sfnt/ttload.c
    ... ... @@ -1312,6 +1312,12 @@
    1312 1312
         if ( FT_STREAM_READ_FIELDS( post_fields, post ) )
    
    1313 1313
           return error;
    
    1314 1314
     
    
    1315
    +    if ( post->FormatType != 0x00030000L &&
    
    1316
    +         post->FormatType != 0x00025000L &&
    
    1317
    +         post->FormatType != 0x00020000L &&
    
    1318
    +         post->FormatType != 0x00010000L )
    
    1319
    +      return FT_THROW( Invalid_Post_Table_Format );
    
    1320
    +
    
    1315 1321
         /* we don't load the glyph names, we do that in another */
    
    1316 1322
         /* module (ttpost).                                     */
    
    1317 1323
     
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]