File: fixes

package info (click to toggle)
mknfonts.tool 0.5-12
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 128 kB
  • sloc: objc: 540; sh: 44; makefile: 41
file content (471 lines) | stat: -rw-r--r-- 13,330 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 mknfonts.tool (0.5-12) unstable; urgency=medium
 .
   * debian/control: Add myself to Uploaders.
   * Bump debhelper version to 11.
   * Bump standards version to 4.1.3.
   * Replace freetype-config with pkg-config freetype2. (Closes: #892345)
   * Added Homepage field.
   * debian/source/format: Bump to 3.0.
Author: Gürkan Myczko <gurkan@phys.ethz.ch>
Bug-Debian: https://bugs.debian.org/892345

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2018-03-09

--- mknfonts.tool-0.5.orig/GNUmakefile
+++ mknfonts.tool-0.5/GNUmakefile
@@ -9,8 +9,8 @@ VERSION = 0.5
 
 ADDITIONAL_OBJCFLAGS += -Wall -O2
 
-ADDITIONAL_INCLUDE_DIRS += `freetype-config --cflags`
-ADDITIONAL_LDFLAGS += `freetype-config --libs`
+ADDITIONAL_INCLUDE_DIRS += `pkg-config freetype2 --cflags`
+ADDITIONAL_TOOL_LIBS += `pkg-config freetype2 --libs`
 
 mknfonts_OBJC_FILES = mknfonts.m
 
--- mknfonts.tool-0.5.orig/mknfonts.m
+++ mknfonts.tool-0.5/mknfonts.m
@@ -140,7 +140,7 @@ static struct
 	FT_Face face;
 	int i;
 	const char *psname;
-	int foo,bar;
+	unsigned int foo,bar;
 
 	for (i=1;i<[files count];i++)
 	{
@@ -158,21 +158,21 @@ static struct
 
 	if (FT_New_Face(ftlib,[[files objectAtIndex: 0] cString],0,&face))
 	{
-		fprintf(stderr,"unable to open %@, ignoring\n",[files objectAtIndex: 0]);
+		GSPrintf(stderr,@"unable to open %@, ignoring\n",[files objectAtIndex: 0]);
 		return NO;
 	}
 	for (i=1;i<[files count];i++)
 	{
 		if (FT_Attach_File(face,[[files objectAtIndex: i] cString]))
 		{
-			fprintf(stderr,"warning: unable to attach %@\n",[files objectAtIndex: i]);
+			GSPrintf(stderr,@"warning: unable to attach %@\n",[files objectAtIndex: i]);
 		}
 	}
 
 	psname=FT_Get_Postscript_Name(face);
 	if (!psname)
 	{
-		fprintf(stderr,"couldn't get postscript name for %@, ignoring\n",[files objectAtIndex: 0]);
+		GSPrintf(stderr,@"couldn't get postscript name for %@, ignoring\n",[files objectAtIndex: 0]);
 		return NO;
 	}
 	postScriptName=[[NSString alloc] initWithCString: psname];
@@ -182,7 +182,7 @@ static struct
 
 	if (traits_from_string(faceName,&foo,&bar))
 	{
-		fprintf(stderr,"warning: couldn't fully parse '%@' (%@)\n",faceName,postScriptName);
+		GSPrintf(stderr,@"warning: couldn't fully parse '%@' (%@)\n",faceName,postScriptName);
 	}
 
 	FT_Done_Face(face);
@@ -284,7 +284,7 @@ int main(int argc, char **argv)
 		NSFileManager *fm=[NSFileManager defaultManager];
 		NSEnumerator *e;
 		NSString *family;
-		int i,c,j;
+		int i,c;
 
 		NSMutableDictionary *family_info;
 		NSMutableArray *faces;
@@ -310,12 +310,6 @@ int main(int argc, char **argv)
 			{
 				fi=[faceinfos objectAtIndex: i];
 				[faces addObject: [fi faceInfoDictionary]];
-				for (j=0;j<[fi->files count];j++)
-				{
-					[fm movePath: [fi->files objectAtIndex: j]
-						toPath: [path stringByAppendingPathComponent: [[fi->files objectAtIndex: j] lastPathComponent]]
-						handler: nil];
-				}
 			}
 
 			[family_info
--- /dev/null
+++ mknfonts.tool-0.5/nfont_packages.txt
@@ -0,0 +1,294 @@
+I've used [ ] to mark parts that aren't _really_ part of the spec, eg.
+TODOs, undecided issues, and implementation notes.
+
+
+.nfont packages
+===============
+
+[.nfont packages are used by back-art to load fonts (and may be used by
+back-gslib as well, although that's undecided).]
+
+
+An .nfont package (ie. a directory with the extension ".nfont") contains
+a single, complete family. The directory contains a FontInfo.plist with
+information about the family, and any files needed to render the faces
+in the family, referenced from FontInfo.plist. FontInfo.plist contains a
+dictionary.
+
+By default, the family name is the name of the font package (without the
+.nfont extension), though an explicit Family key can change it.
+
+.nfont packages are located in Library/Fonts/ of any domain. When
+searching for fonts, .nfont packages in the user domain override any
+.nfont packages with the same name in the the local domain, which in turn
+override any in the network domain, which override any in the system
+domain.
+
+
+The top-level dictionary
+------------------------
+
+The only required key in FontInfo.plist is "Faces", an array of faces in
+the package.
+
+
+Optional keys that are parsed are:
+
+Traits
+  Sets the default family traits.
+
+Weight
+  Sets the default family weight.
+
+Family
+  Sets the family name explicitly.
+
+
+Other arbitrary keys can be added to provide more information, and their
+values will be ignored, but since future changes might cause clashes,
+it's recommended that the following be used:
+
+Version
+  A version number for the font _package_ (not the font files). When a new,
+  changed version of the font package is released (eg. with updated font
+  files, or just with changes to FontInfo.plist), this should be increased.
+  It is highly recommended that this key be included.
+  [TODO: Make it required? Define the format of the version number, and a
+  default number if the key is missing?]
+  
+Foundry
+  The font's foundry.
+
+FontLicense
+  The license that the font files are covered by.
+
+FontCopyright
+  Copyright statement for the font files.
+
+[
+Ideas:
+
+License
+Copyright
+  Copyright and license for FontInfo.plist. Necessary?
+
+Packager
+  Name and contact information of the person who created the .nfont package.
+
+Description
+  Free text description of the font.
+
+URL
+
+TODO: talk to fabien about the .nfont inspector
+]
+
+
+Faces
+-----
+
+The Faces array contains a dictionary for each face.
+
+The font name (used eg. in [NSFont +fontWithName:size:]) is the value of
+the PostScriptName key. The display name is formed by appending a space
+and the localized face name to the family name.
+
+
+Keys in the face dictionary:
+
+PostScriptName (required)
+  The face's postscript name. This is the name used as the face's name for
+  most internal purposes.
+
+
+(exactly one of Name and LocalizedNames must be present)
+Name
+  The face name, in English. The name will be automatically localized by
+  looking it up in a list of standard names and translations. This means
+  that new languages can be added in one place, and all faces will be
+  updated. It only works for certain standard names, but for those names,
+  this is the recommended way of specifying the face name.
+  [TODO
+  Define which names are 'standard'. Will include _really_ standard stuff
+  like "Bold", "Italic", "Regular", etc.
+  ]
+
+LocalizedNames
+  A dictionary that maps languages to localized face names. Each key is
+  a language name [like the ones you'd use for localized resources, etc.;
+  there should be docs about that], and the value is the name of the face
+  in that language. [If the user's preferred language can't be found,
+  "English" will be used if present, otherwise a random entry. TODO: match
+  behavior for LANGUAGES]
+  The dictionary should contain an entry for "English". Automatic trait
+  parsing won't work if there isn't an entry for "English".
+  [This needs a reference to some "How localization works" specs]
+  
+
+Files
+  An array of files to load for this face. (Technically, the first file is
+  loaded with FT_New_Face(), and subsequent files using FT_Attach_File().
+  Thus, the main file (according to freetype) for the face needs to be
+  first. [In practice this means that the .pfa/.pfb file needs to come
+  before any .afm/.pfm files.])
+
+  By default, this is empty and there is no general way to render this font.
+
+ScreenFonts
+  A dictionary of (integer) pixel sizes, as strings, and the font files to
+  use for that size instead of the files specified in the Files key. Each
+  key is a size, in pixels. Each value is an array of files to load (just
+  like the value of the "Files" key).
+
+Traits
+  The traits of this face.
+
+Weight
+  The weight of this face.
+
+[TODO
+Add a way to remove traits from the family traits? xor instead of or?
+]
+
+[TODO
+RenderHints_hack
+  A bit field with hints for the font renderer. This is a hack and needs to,
+  be cleaned up, but the format is (from back/Source/art/ftfont.m):
+
+  hinting hints
+    0: 1 to use the auto-hinter
+    1: 1 to use hinting
+  byte 0 and 1 contain hinting hints for un-antialiased and antialiased
+  rendering, respectively.
+
+   16: 0=un-antialiased by default, 1=antialiased by default
+]
+
+
+Traits and weights
+------------------
+
+Weight values are integers 1<=x<=14. Lower is lighter, higher is heavier:
+
+  4  book
+  5  regular
+  6  medium
+  9  bold
+ 11  heavy
+
+[There's a complete list in gui/Source/GSFontInfo.m, but I don't know how
+much of this is 'standard' and how much is robust parsing in there.]
+
+The default family weight is 5.
+
+The weight of a face is determined from:
+ 1. An explicit "Weight" key in the face dictionary, if present.
+ 2. A weight determined from the face name, if possible.
+ 3. The family weight.
+
+
+Trait values are combinations of the NS*FontMask flags in NSFontManager.
+[Insert neat link to NSFont/NSFontManager traits/weight documentation.]
+
+The default family traits are 0.
+
+The traits of a face is the binary or of the face traits and the family
+traits. If the face dictionary has an explicit "Traits" key, the face
+traits get that value. If not, the face name is parsed to find the face
+traits. If the parsing fails or doesn't find any traits in the name, the
+face traits are 0.
+
+
+[TODO: Specify how name parsing is done?]
+
+
+Example FontInfo.plist
+----------------------
+
+An example of a normal FontInfo.plist for a family.
+
+Arial.nfont/FontInfo.plist
+--- cut here ---
+{
+	Foundry = "Monotype";
+	Faces = (
+	{
+		Name = "Regular";
+		PostScriptName = "ArialMT";
+		Files = ("arial.ttf");
+		RenderHints_hack = 0x00202;
+	},
+	{
+		Name = "Bold";
+		PostScriptName = "Arial-BoldMT";
+		Files = ("arialbd.ttf");
+	},
+	{
+		LocalizedNames = {
+			English = "Rounded Bold";
+			Swedish = "Rundad Fet";
+		};
+		PostScriptName = "ArialRoundedMTBold";
+		Files = ("arlrdbd.ttf");
+	}
+	);
+	Version = 2;
+}
+--- cut here ---
+
+
+An example of a package with an explicitly specified family name.
+
+Arial Narrow.nfont/FontInfo.plist
+--- cut here ---
+{
+    Faces = (
+	{
+	    Files = (
+		ArialNi.ttf
+	    );
+	    Name = "Narrow Italic";
+	    PostScriptName = "ArialNarrow-Italic";
+	},
+	{
+	    Files = (
+		arialn.ttf
+	    );
+	    Name = Narrow;
+	    PostScriptName = ArialNarrow;
+	}
+    );
+    Family = Arial;
+}
+--- cut here ---
+
+[
+TODO?
+
+.font packages
+--------------
+
+back-art also loads .font packages, though it's a bit late to specify them.
+Since a .font package really only contains one face, it isn't a perfect
+match, but it works.
+
+Traits and weights are determined by parsing the names. An .nfont package
+in a later (or same) domain will override all .font packages for that family,
+and .font packages in a later domain will override .nfont or .font packages
+in an earlier domain (so all .font packages for a family need to be in the
+same domain).
+]
+
+--
+Author: Alexander Malmberg <alexander@malmberg.org>
+Copyright 2002 Alexander Malmberg
+
+Thanks to:
+Jeff Teunissen
+
+--
+
+$Revision: 1.9 $
+$Date: 2002/10/01 16:47:27 $
+
+
--- /dev/null
+++ mknfonts.tool-0.5/update-nfonts
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+input=/usr/share/fonts/
+output=/usr/lib/GNUstep/System/Library/Fonts/
+# if non root user ~/GNUstep/Library/Fonts/
+if [ "`id`" != "`id root`" ]; then
+    mkdir -p ~/GNUstep/Library/Fonts/
+    output=`echo ~/GNUstep/Library/Fonts/`
+fi
+
+for z in ttf pfa pfb otf; do
+    cd $output
+    find $input -name "*.${z}" -type f -print | while read a; do
+	if test -f $a; then
+	    bna=`basename "$a"`
+	    echo "Preparing $bna for nfont"
+	    ln -s "$a" "$bna" 2>/dev/null
+        fi
+    done
+done
+#symlinks -dv $output
+c=0
+b=""
+printf "Creating nfonts"
+for z in ttf pfa pfb otf; do
+    for a in $z; do
+	b="$b *.${a}"
+	c=$((c+1))
+	if test $c -eq 15; then
+	    mknfonts $b 2>/dev/null
+	    printf "."
+	    b=""
+	    c=0
+	fi
+    done
+    mknfonts $b 2>/dev/null
+    echo
+done
+#cd
+
+exit
+
+#the bottom one is ugly and the top one too (but the top one is faster)
+#and we need it until gnustep has the argumentlist limit removed.
+
+#!/bin/sh
+
+input=/usr/share/fonts/
+output=/usr/lib/GNUstep/System/Library/Fonts/
+mask="*.ttf"
+
+cd $output
+find $input -name "$mask" -type f -print |while read a; do
+    ln -s "$a" "`basename "$a"`" 2>/dev/null
+done
+#symlinks -dv $output
+for a in $mask; do
+    mknfonts "$a"
+done
+#cd