summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/font/writefont.c
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2009-04-16 07:56:44 +0000
committerTaco Hoekwater <taco@elvenkind.com>2009-04-16 07:56:44 +0000
commit40c2ba944e1cee0677734608263cbc7ba3a729bf (patch)
tree6da3acbd4e74eb5854f90416313fb56a4eb29824 /Build/source/texk/web2c/luatexdir/font/writefont.c
parent79e9c535970a1887e1b6b2196cd90775955ea486 (diff)
Import luatex 0.39.0
git-svn-id: svn://tug.org/texlive/trunk@12733 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/font/writefont.c')
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writefont.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/Build/source/texk/web2c/luatexdir/font/writefont.c b/Build/source/texk/web2c/luatexdir/font/writefont.c
index 5c6b2d905a0..b15b71489e8 100644
--- a/Build/source/texk/web2c/luatexdir/font/writefont.c
+++ b/Build/source/texk/web2c/luatexdir/font/writefont.c
@@ -22,7 +22,7 @@
#include "luatexfont.h"
static const char _svn_version[] =
- "$Id: writefont.c 2097 2009-03-23 22:45:03Z hhenkel $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/writefont.c $";
+ "$Id: writefont.c 2274 2009-04-13 12:10:20Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writefont.c $";
void write_cid_fontdictionary(fo_entry * fo, internalfontnumber f);
void create_cid_fontdictionary(fm_entry * fm, integer font_objnum,
@@ -713,6 +713,21 @@ void create_fontdictionary(fm_entry * fm, integer font_objnum,
/**********************************************************************/
+static int has_ttf_outlines(fm_entry *fm)
+{
+ FILE *f = fopen(fm->ff_name,"rb");
+ if (f!=NULL) {
+ int ch1 = getc(f);
+ int ch2 = getc(f);
+ int ch3 = getc(f);
+ int ch4 = getc(f);
+ fclose (f);
+ if (ch1=='O' && ch2=='T' && ch3=='T' && ch4=='O')
+ return 0;
+ return 1;
+ }
+ return 0;
+}
void do_pdf_font(integer font_objnum, internalfontnumber f)
{
@@ -740,7 +755,11 @@ void do_pdf_font(integer font_objnum, internalfontnumber f)
switch (font_format(f)) {
case opentype_format:
- set_opentype(fm);
+ if (has_ttf_outlines(fm)) {
+ set_truetype(fm);
+ } else {
+ set_opentype(fm);
+ }
break;
case truetype_format:
set_truetype(fm);