summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuliusz Chroboczek <Juliusz.Chroboczek@pps.jussieu.fr>2003-05-12 09:04:24 +0000
committerJuliusz Chroboczek <Juliusz.Chroboczek@pps.jussieu.fr>2003-05-12 09:04:24 +0000
commit0f362ad520e61e096c887f9374a485c3df32655a (patch)
tree7e0a7e5b8c4baebfde62e65358ecafa44dc23120
parentd47c9d6efec6c3c086efc187c68d79ca0c077dfa (diff)
Generate FC_SIZE and FC_DPI for legacy bitmap fonts
-rw-r--r--src/fcfreetype.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index 31da0c6..4144294 100644
--- a/src/fcfreetype.c
+++ b/src/fcfreetype.c
@@ -978,6 +978,47 @@ FcFreeTypeQuery (const FcChar8 *file,
goto bail1;
if (!FcPatternAddBool (pat, FC_ANTIALIAS, FcFalse))
goto bail1;
+#ifdef USE_FTBDF
+ if(face->num_fixed_sizes == 1) {
+ int rc;
+ int value;
+ BDF_PropertyRec prop;
+
+ rc = MY_Get_BDF_Property(face, "PIXEL_SIZE", &prop);
+ if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_INTEGER)
+ value = prop.u.integer;
+ else if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_CARDINAL)
+ value = prop.u.cardinal;
+ else
+ goto nevermind;
+ if(value != face->available_sizes[0].height)
+ /* ``impossible'' */
+ goto nevermind;
+
+ rc = MY_Get_BDF_Property(face, "POINT_SIZE", &prop);
+ if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_INTEGER)
+ value = prop.u.integer;
+ else if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_CARDINAL)
+ value = prop.u.cardinal;
+ else
+ goto nevermind;
+ if(!FcPatternAddDouble(pat, FC_SIZE, value / 10.0))
+ goto nevermind;
+
+ rc = MY_Get_BDF_Property(face, "RESOLUTION_Y", &prop);
+ if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_INTEGER)
+ value = prop.u.integer;
+ else if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_CARDINAL)
+ value = prop.u.cardinal;
+ else
+ goto nevermind;
+ if(!FcPatternAddDouble(pat, FC_DPI, (double)value))
+ goto nevermind;
+
+ }
+ nevermind:
+ ;
+#endif
}
/*