fonts: fix average width
Huw D M Davies
h.davies1 at physics.ox.ac.uk
Mon Nov 15 05:50:47 CST 2004
Huw Davies <huw at codeweavers.com>
Calculating the average width doesn't seem possible, so
set it manually instead.
Fix the copyright in wine_system
--
Huw Davies
huw at codeweavers.com
Index: fonts/Makefile.in
===================================================================
RCS file: /home/wine/wine/fonts/Makefile.in,v
retrieving revision 1.9
diff -u -r1.9 Makefile.in
--- fonts/Makefile.in 28 Sep 2004 02:36:06 -0000 1.9
+++ fonts/Makefile.in 15 Nov 2004 11:35:48 -0000
@@ -28,43 +28,43 @@
@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
Index: fonts/wine_system.sfd
===================================================================
RCS file: /home/wine/wine/fonts/wine_system.sfd,v
retrieving revision 1.4
diff -u -r1.4 wine_system.sfd
--- fonts/wine_system.sfd 13 Sep 2004 19:17:17 -0000 1.4
+++ fonts/wine_system.sfd 15 Nov 2004 11:35:48 -0000
@@ -3,7 +3,7 @@
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 @@
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
Index: tools/sfnt2fnt.c
===================================================================
RCS file: /home/wine/wine/tools/sfnt2fnt.c,v
retrieving revision 1.2
diff -u -r1.2 sfnt2fnt.c
--- tools/sfnt2fnt.c 22 Aug 2004 02:01:21 -0000 1.2
+++ tools/sfnt2fnt.c 15 Nov 2004 11:35:48 -0000
@@ -92,7 +92,7 @@
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 @@
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 @@
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 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 @@
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 @@
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);
}
More information about the wine-patches
mailing list