Caching Postscript names

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



First, I must apologize if this is a double post. When I first sent
this email I had not yet subscribed to the list, and I don't think it

I am working on GNUstep's ( font support. One
of GNUstep's goals is to implement the OpenStep specification
( Fontconfig is
already being used by GNUstep, however, in order to properly implement
the OpenStep standard  the Postscript name should be used to uniquely
reference a font. Right now GNUstep is using the full font name,
however, it would be better if the Postscript name was cached so that
it could be used instead. So my final question is: what are the pros
and cons to adding the Postscript name to the properties which
Fontconfig caches?

I've included a patch (below) which adds the functionality.

- Isaiah Beerbower

diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h
index 425fc2d..10d5762 100644
--- a/fontconfig/fontconfig.h
+++ b/fontconfig/fontconfig.h
@@ -81,6 +81,7 @@ typedef int           FcBool;
 #define FC_PIXEL_SIZE      "pixelsize"         /* Double */
 #define FC_SPACING         "spacing"           /* Int */
 #define FC_FOUNDRY         "foundry"           /* String */
+#define FC_POSTSCRIPT_NAME         "postscriptname"            /* String */
 #define FC_ANTIALIAS       "antialias"         /* Bool (depends) */
 #define FC_HINTING         "hinting"           /* Bool (true) */
 #define FC_HINT_STYLE      "hintstyle"         /* Int */
diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index a79308c..c041249 100644
--- a/src/fcfreetype.c
+++ b/src/fcfreetype.c
@@ -1121,6 +1121,7 @@ FcFreeTypeQueryFace (const FT_Face  face,
    FcChar8        *complex;
    const FcChar8   *foundry = 0;
+    const FcChar8   *psname = 0;
    int                    spacing;
    TT_OS2         *os2;
@@ -1370,6 +1371,13 @@ FcFreeTypeQueryFace (const FT_Face  face,

+       psname = (const FcChar8 *) FT_Get_Postscript_Name(face);
+       if (psname)
+       {
+    if (!FcPatternAddString (pat, FC_POSTSCRIPT_NAME, psname))
+       goto bail1;
+       }
    if (!FcPatternAddString (pat, FC_FILE, file))
       goto bail1;

Fontconfig mailing list

[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux