summaryrefslogtreecommitdiff
path: root/psdata.c
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2006-12-31 21:38:46 +0000
committerBen Harris <bjh21@bjh21.me.uk>2006-12-31 21:38:46 +0000
commitb83d28dfd3434a31fd42f0596ab299a2626230d6 (patch)
treed8c6b249a72b3efde10d94aca581c6a13e7195b3 /psdata.c
parentdb26c259e5ecd9db2b9c914854b12f8ac7d7a558 (diff)
downloadhalibut-b83d28dfd3434a31fd42f0596ab299a2626230d6.zip
halibut-b83d28dfd3434a31fd42f0596ab299a2626230d6.tar.gz
halibut-b83d28dfd3434a31fd42f0596ab299a2626230d6.tar.bz2
halibut-b83d28dfd3434a31fd42f0596ab299a2626230d6.tar.xz
Initial ligature support. This adds support for emitting ligatures, and adds
the "fi" and "fl" ligatures to the built-in fonts, but doesn't add support for reading ligature information from AFM files because that requires coping with forward references to glyph names, which is tricky. [originally from svn r7045]
Diffstat (limited to 'psdata.c')
-rw-r--r--psdata.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/psdata.c b/psdata.c
index 8c3b9cd..04046be 100644
--- a/psdata.c
+++ b/psdata.c
@@ -4087,8 +4087,17 @@ static const struct ps_std_font_data {
}},
};
+/*
+ * Rough kludge to get ligatures in until this is all rewritten. All
+ * the standard fonts have the same ligatures anyway.
+ */
+static ligature const ps_std_ligs[] = {
+ {31,34,160}, {31,37,162}, {0xFFFF,0xFFFF,0xFFFF}
+};
+
void init_std_fonts(void) {
int i, j;
+ ligature const *lig;
kern_pair const *kern;
static int done = FALSE;
@@ -4103,6 +4112,9 @@ void init_std_fonts(void) {
fi->kerns = newtree234(kern_cmp);
for (kern = ps_std_fonts[i].kerns; kern->left != 0xFFFF; kern++)
add234(fi->kerns, (void *)kern);
+ fi->ligs = newtree234(lig_cmp);
+ for (lig = ps_std_ligs; lig->left != 0xFFFF; lig++)
+ add234(fi->ligs, (void *)lig);
for (j = 0; j < (int)lenof(fi->bmp); j++)
fi->bmp[j] = 0xFFFF;
for (j = 0; j < fi->nglyphs; j++) {