freetype-devel
[Top][All Lists]
Advanced

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

[Devel] PFR FontMatrix


From: Detlef Würkner
Subject: [Devel] PFR FontMatrix
Date: Thu, 27 Jun 2002 20:49:18 +0200

address@hidden (Sven Neumann) wrote:

> address@hidden (Detlef Würkner) writes:
> 
> > Btw, the PFR driver parses the FontMatrix (log_font->matrix[]) but does
> > not apply it to the font. But didnt find a PFR font with a matrix
> > different from [256, 0, 0, 256] (read [1.0 0 0 1.0]) anyway...
> 
> however it wouldn't hurt to add code that applies the matrix, or would
> it?

Hm. What about this?

----8<----
--- freetype-2.1.2/src/pfr/pfrobjs.c.ori        Sat Jun 22 13:35:41 2002
+++ freetype-2.1.2/src/pfr/pfrobjs.c    Thu Jun 27 18:44:46 2002
@@ -288,6 +288,21 @@
       metrics->vertBearingX = 0;
       metrics->vertBearingY = 0;
 
+#if 1
+      /* apply the font matrix, if any                     */
+      /* TODO: test with existing font with unusual matrix */
+      /* whether we have to adjust Units per EM            */
+      {
+        FT_Matrix font_matrix;
+
+        font_matrix.xx = face->log_font.matrix[0] << 8;
+        font_matrix.yx = face->log_font.matrix[1] << 8;
+        font_matrix.xy = face->log_font.matrix[2] << 8;
+        font_matrix.yy = face->log_font.matrix[3] << 8;
+        FT_Outline_Transform( outline, &font_matrix );
+      }
+#endif
+
       /* scale when needed */
       if ( scaling )
       {
----8<----

Ciao, Detlef
-- 
_ // address@hidden
\X/  Detlef Wuerkner, Langgoens/Germany



reply via email to

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