freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][undefined_scale] [base] Undefined scale means n


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][undefined_scale] [base] Undefined scale means no scale.
Date: Wed, 19 Jan 2022 19:55:33 +0000

Alexei Podtelezhnikov pushed to branch undefined_scale at FreeType / FreeType

Commits:

2 changed files:

Changes:

  • include/freetype/freetype.h
    ... ... @@ -522,13 +522,13 @@ FT_BEGIN_HEADER
    522 522
        *   size.
    
    523 523
        *
    
    524 524
        * @note:
    
    525
    -   *   An @FT_Face has one _active_ @FT_Size object that is used by functions
    
    525
    +   *   An @FT_Face has one _active_ FT_Size object that is used by functions
    
    526 526
        *   like @FT_Load_Glyph to determine the scaling transformation that in
    
    527 527
        *   turn is used to load and hint glyphs and metrics.
    
    528 528
        *
    
    529 529
        *   You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, @FT_Request_Size
    
    530 530
        *   or even @FT_Select_Size to change the content (i.e., the scaling
    
    531
    -   *   values) of the active @FT_Size.
    
    531
    +   *   values) of the active FT_Size.
    
    532 532
        *
    
    533 533
        *   You can use @FT_New_Size to create additional size objects for a given
    
    534 534
        *   @FT_Face, but they won't be used by other functions until you activate
    
    ... ... @@ -2819,7 +2819,7 @@ FT_BEGIN_HEADER
    2819 2819
        *
    
    2820 2820
        *   load_flags ::
    
    2821 2821
        *     A flag indicating what to load for this glyph.  The @FT_LOAD_XXX
    
    2822
    -   *     constants can be used to control the glyph loading process (e.g.,
    
    2822
    +   *     flags can be used to control the glyph loading process (e.g.,
    
    2823 2823
        *     whether the outline should be scaled, whether to load bitmaps or
    
    2824 2824
        *     not, whether to hint the outline, etc).
    
    2825 2825
        *
    
    ... ... @@ -2827,6 +2827,9 @@ FT_BEGIN_HEADER
    2827 2827
        *   FreeType error code.  0~means success.
    
    2828 2828
        *
    
    2829 2829
        * @note:
    
    2830
    +   *   For proper scaling and hinting, the active @FT_Size object owned by
    
    2831
    +   *   the face has to be meaningfully non-trivially initialized by
    
    2832
    +   *   calling @FT_Set_Char_Size before this function, for example.
    
    2830 2833
        *   The loaded glyph may be transformed.  See @FT_Set_Transform for the
    
    2831 2834
        *   details.
    
    2832 2835
        *
    
    ... ... @@ -2918,6 +2921,8 @@ FT_BEGIN_HEADER
    2918 2921
        *
    
    2919 2922
        *   FT_LOAD_NO_SCALE ::
    
    2920 2923
        *     Don't scale the loaded outline glyph but keep it in font units.
    
    2924
    +   *     This flag is also assumed if @FT_Size owned by the face was not
    
    2925
    +   *     properly initialized.
    
    2921 2926
        *
    
    2922 2927
        *     This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and
    
    2923 2928
        *     unsets @FT_LOAD_RENDER.
    

  • src/base/ftobjs.c
    ... ... @@ -858,6 +858,11 @@
    858 858
         library = driver->root.library;
    
    859 859
         hinter  = library->auto_hinter;
    
    860 860
     
    
    861
    +    /* undefined scale means no scale */
    
    862
    +    if ( face->size->metrics.x_ppem == 0 ||
    
    863
    +         face->size->metrics.y_ppem == 0 )
    
    864
    +      load_flags |= FT_LOAD_NO_SCALE;
    
    865
    +
    
    861 866
         /* resolve load flags dependencies */
    
    862 867
     
    
    863 868
         if ( load_flags & FT_LOAD_NO_RECURSE )
    


  • reply via email to

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