From 9e4a58136c053335f410ce75225466db6ef4d318 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Fri, 19 Nov 2004 18:23:52 +0000 Subject: [PATCH] Calculating the average width doesn't seem possible, so set it manually instead. Fix the copyright in wine_system. --- fonts/Makefile.in | 32 ++++++++++++++++---------------- fonts/wine_system.sfd | 6 +++--- tools/sfnt2fnt.c | 20 ++++++++------------ 3 files changed, 27 insertions(+), 31 deletions(-) diff --git a/fonts/Makefile.in b/fonts/Makefile.in index f879edbb012..f90afcca46c 100644 --- a/fonts/Makefile.in +++ b/fonts/Makefile.in @@ -28,46 +28,46 @@ all: $(FONTS) @MAKE_RULES@ wine_courier-1252-96-13.fnt: wine_courier.ttf $(SFNT2FNT) - $(LDPATH) $(SFNT2FNT) wine_courier.ttf 13 1252 96 128 + $(LDPATH) $(SFNT2FNT) wine_courier.ttf 13 1252 96 128 8 wine_courier-1250-96-13.fnt: wine_courier.ttf $(SFNT2FNT) - $(LDPATH) $(SFNT2FNT) wine_courier.ttf 13 1250 96 128 + $(LDPATH) $(SFNT2FNT) wine_courier.ttf 13 1250 96 128 8 wine_courier-1251-96-13.fnt: wine_courier.ttf $(SFNT2FNT) - $(LDPATH) $(SFNT2FNT) wine_courier.ttf 13 1251 96 128 + $(LDPATH) $(SFNT2FNT) wine_courier.ttf 13 1251 96 128 8 wine_sans_serif-1252-96-13.fnt: wine_sans_serif.ttf $(SFNT2FNT) - $(LDPATH) $(SFNT2FNT) wine_sans_serif.ttf 13 1252 96 129 + $(LDPATH) $(SFNT2FNT) wine_sans_serif.ttf 13 1252 96 129 5 wine_sans_serif-1252-96-16.fnt: wine_sans_serif.ttf $(SFNT2FNT) - $(LDPATH) $(SFNT2FNT) wine_sans_serif.ttf 16 1252 96 129 + $(LDPATH) $(SFNT2FNT) wine_sans_serif.ttf 16 1252 96 129 7 wine_sans_serif-1252-96-20.fnt: wine_sans_serif.ttf $(SFNT2FNT) - $(LDPATH) $(SFNT2FNT) wine_sans_serif.ttf 20 1252 96 129 - -wine_sans_serif-1251-96-20.fnt: wine_sans_serif.ttf $(SFNT2FNT) - $(LDPATH) $(SFNT2FNT) wine_sans_serif.ttf 20 1251 96 129 + $(LDPATH) $(SFNT2FNT) wine_sans_serif.ttf 20 1252 96 129 8 wine_sans_serif-1250-96-13.fnt: wine_sans_serif.ttf $(SFNT2FNT) - $(LDPATH) $(SFNT2FNT) wine_sans_serif.ttf 13 1250 96 129 + $(LDPATH) $(SFNT2FNT) wine_sans_serif.ttf 13 1250 96 129 5 wine_sans_serif-1250-96-16.fnt: wine_sans_serif.ttf $(SFNT2FNT) - $(LDPATH) $(SFNT2FNT) wine_sans_serif.ttf 16 1250 96 129 + $(LDPATH) $(SFNT2FNT) wine_sans_serif.ttf 16 1250 96 129 7 wine_sans_serif-1251-96-13.fnt: wine_sans_serif.ttf $(SFNT2FNT) - $(LDPATH) $(SFNT2FNT) wine_sans_serif.ttf 13 1251 96 129 + $(LDPATH) $(SFNT2FNT) wine_sans_serif.ttf 13 1251 96 129 5 wine_sans_serif-1251-96-16.fnt: wine_sans_serif.ttf $(SFNT2FNT) - $(LDPATH) $(SFNT2FNT) wine_sans_serif.ttf 16 1251 96 129 + $(LDPATH) $(SFNT2FNT) wine_sans_serif.ttf 16 1251 96 129 7 + +wine_sans_serif-1251-96-20.fnt: wine_sans_serif.ttf $(SFNT2FNT) + $(LDPATH) $(SFNT2FNT) wine_sans_serif.ttf 20 1251 96 129 8 wine_system-1252-96-16.fnt: wine_system.ttf $(SFNT2FNT) - $(LDPATH) $(SFNT2FNT) wine_system.ttf 16 1252 96 128 + $(LDPATH) $(SFNT2FNT) wine_system.ttf 16 1252 96 128 7 wine_system-1250-96-16.fnt: wine_system.ttf $(SFNT2FNT) - $(LDPATH) $(SFNT2FNT) wine_system.ttf 16 1250 96 128 + $(LDPATH) $(SFNT2FNT) wine_system.ttf 16 1250 96 128 7 wine_system-1251-96-16.fnt: wine_system.ttf $(SFNT2FNT) - $(LDPATH) $(SFNT2FNT) wine_system.ttf 16 1251 96 128 + $(LDPATH) $(SFNT2FNT) wine_system.ttf 16 1251 96 128 7 wine_sserife.fon: wine_sans_serif-1252-96-13.fnt wine_sans_serif-1252-96-16.fnt wine_sans_serif-1252-96-20.fnt $(FNT2FON) $(FNT2FON) wine_sans_serif-1252-96-13.fnt wine_sans_serif-1252-96-16.fnt wine_sans_serif-1252-96-20.fnt $@ diff --git a/fonts/wine_system.sfd b/fonts/wine_system.sfd index 6c34086d5e2..a69ec4c14b9 100644 --- a/fonts/wine_system.sfd +++ b/fonts/wine_system.sfd @@ -3,7 +3,7 @@ FontName: wine_system FullName: Wine System FamilyName: Wine System Weight: Bold -Copyright: Created by Huw D M Davies with FontForge 1.0 (http://fontforge.sf.net) +Copyright: Copyright (C) 2004 Huw D M Davies Comments: 2004-7-15: Created. Version: 001.000 ItalicAngle: 0 @@ -30,13 +30,13 @@ HheadDOffset: 1 ScriptLang: 2 1 latn 1 dflt 1 DFLT 1 dflt -LangName: 1033 "Copyright (C) 2004 Huw D M Davies" "" "" "" "" "" "" "" "Created with FontForge 1.0 (http://fontforge.sourceforge.net)" "Huw D M Davies" "" "http://www.winehq.org" "" "This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.+AAoA +AAoA-This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.+AAoA +AAoA-You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA+AAoA" "http://www.gnu.org/licenses/lgpl.html" +LangName: 1033 "" "" "" "" "" "" "" "" "Created with FontForge 1.0 (http://fontforge.sourceforge.net)" "Huw D M Davies" "" "http://www.winehq.org" "" "This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.+AAoA +AAoA-This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.+AAoA +AAoA-You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA+AAoA" "http://www.gnu.org/licenses/lgpl.html" Encoding: unicode UnicodeInterp: none DisplaySize: 16 AntiAlias: 0 FitToEm: 1 -WinInfo: 0 18 12 +WinInfo: 0 18 16 OnlyBitmaps: 1 BeginChars: 65536 344 StartChar: space diff --git a/tools/sfnt2fnt.c b/tools/sfnt2fnt.c index 0ffe7e3a9b3..eaa656a82b7 100644 --- a/tools/sfnt2fnt.c +++ b/tools/sfnt2fnt.c @@ -92,7 +92,7 @@ typedef struct { void usage(char **argv) { - fprintf(stderr, "%s foo.ttf ppem enc dpi def_char\n", argv[0]); + fprintf(stderr, "%s foo.ttf ppem enc dpi def_char avg_width\n", argv[0]); return; } @@ -150,9 +150,9 @@ int lookup_charset(int enc) return OEM_CHARSET; } -static void fill_fontinfo(FT_Face face, int enc, FILE *fp, int dpi, unsigned char def_char) +static void fill_fontinfo(FT_Face face, int enc, FILE *fp, int dpi, unsigned char def_char, int avg_width) { - int ascent, il, ppem, descent, avg_width, width_bytes = 0, space_size, max_width = 0; + int ascent, il, ppem, descent, width_bytes = 0, space_size, max_width = 0; FNT_HEADER hdr; FONTINFO16 fi; BYTE left_byte, right_byte, byte; @@ -194,12 +194,6 @@ static void fill_fontinfo(FT_Face face, int enc, FILE *fp, int dpi, unsigned cha if(!strcmp(face->family_name, "Wine Courier")) il = 0; - if(FT_Load_Char(face, 'X', FT_LOAD_DEFAULT)) { - fprintf(stderr, "Can't find X\n"); - exit(0); - } - avg_width = face->glyph->metrics.horiAdvance >> 6; - first_char = FT_Get_First_Char(face, &gi); if(first_char == 0xd) /* fontforge's first glyph is 0xd, we'll catch this and skip it */ first_char = FT_Get_Next_Char(face, first_char, &gi); @@ -361,13 +355,13 @@ int main(int argc, char **argv) int ppem, enc; FT_Face face; FT_Library lib; - int dpi; + int dpi, avg_width; unsigned int def_char; FILE *fp; char output[256]; char name[256]; char *cp; - if(argc != 6) { + if(argc != 7) { usage(argv); exit(0); } @@ -376,6 +370,8 @@ int main(int argc, char **argv) enc = atoi(argv[3]); dpi = atoi(argv[4]); def_char = atoi(argv[5]); + avg_width = atoi(argv[6]); + if(FT_Init_FreeType(&lib)) { fprintf(stderr, "ft init failure\n"); exit(0); @@ -405,7 +401,7 @@ int main(int argc, char **argv) fp = fopen(output, "w"); - fill_fontinfo(face, enc, fp, dpi, def_char); + fill_fontinfo(face, enc, fp, dpi, def_char, avg_width); fclose(fp); exit(0); }