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
