freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master 0da2a11: [truetype] Upstream the hdmx binary search.


From: Werner Lemberg
Subject: [freetype2] master 0da2a11: [truetype] Upstream the hdmx binary search.
Date: Mon, 13 Dec 2021 11:50:56 -0500 (EST)

branch: master
commit 0da2a1155ed576646d44ac5f7602e625800abe42
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    [truetype] Upstream the hdmx binary search.
    
    * src/truetype/ttobjs.h (TT_SizeRec): Add `widthp` for the hdmx
    widths.
    * src/truetype/ttobjs.c (tt_size_reset): Initialize `widthp` even
    though it might never be used by the interpreter.
    * src/truetype/ttgload.c (tt_loader_init): Avoid repeated searches
    in the hdmx table.
---
 src/truetype/ttgload.c | 4 +---
 src/truetype/ttobjs.c  | 2 ++
 src/truetype/ttobjs.h  | 2 ++
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 0d8f271..796811b 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -2736,9 +2736,7 @@
 #endif
            !face->postscript.isFixedPitch                                 )
       {
-        loader->widthp = tt_face_get_device_metrics( face,
-                                                     size->metrics->x_ppem,
-                                                     0 );
+        loader->widthp = size->widthp;
       }
       else
         loader->widthp = NULL;
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index 93fc548..5c07b7a 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -1435,6 +1435,8 @@
       size->ttmetrics.y_ratio = 0x10000L;
     }
 
+    size->widthp = tt_face_get_device_metrics( face, size_metrics->x_ppem, 0 );
+
     size->metrics = size_metrics;
 
 #ifdef TT_USE_BYTECODE_INTERPRETER
diff --git a/src/truetype/ttobjs.h b/src/truetype/ttobjs.h
index fd72378..1c4b585 100644
--- a/src/truetype/ttobjs.h
+++ b/src/truetype/ttobjs.h
@@ -282,6 +282,8 @@ FT_BEGIN_HEADER
 
     TT_Size_Metrics    ttmetrics;
 
+    FT_Byte*           widthp;          /* glyph widths from the hdmx table */
+
     FT_ULong           strike_index;      /* 0xFFFFFFFF to indicate invalid */
 
 #ifdef TT_USE_BYTECODE_INTERPRETER



reply via email to

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