On Sun, Oct 16, 2011 at 10:47:50PM +0200, Patrick Gundlach wrote:
> 
> Am 16.10.2011 um 20:56 schrieb Khaled Hosny:
> 
> > On Sun, Oct 16, 2011 at 07:31:39PM +0200, Patrick Gundlach wrote:
> >> Hi Khaled,
> >> 
> >> thanks again very much for your work on luaotfload. It's very useful.
> >> 
> >> At least one question remains: are there any changes regarding type1
> >> fonts? If they are not supported: do you think that a patch will break
> >> the compatibility with Hans' code?
> > 
> > I think it is fairly isolated, you need to define a type1 reader
> > function:
> > 
> > fonts.formats.pfb = "pfb"
> > function fonts.readers.pfb(specification)
> >   -- process specification
> >   -- load the font and process it
> >   -- may be apply an afm file
> >   return tfmtable
> > end
> 
> 
> OK, that's cool. I think I can cook something up. Probably "unstable"
> at the beginning but better than nothing. I already have font loader
> for type1 fonts here (without ligatures yet).

I hacked up a quick type1 reader that used the existing opentype reader.
Works fine except there is a small bug in the opentype reader which sets
the units_per_em to 0 if it is not set.

The font names indexer need to be extended to index type1 fonts as well
(should be just teaching it a couple more extensions to look for).

Regards,
 Khaled
diff --git a/luaotfload.dtx b/luaotfload.dtx
index 90909da..29ba672 100644
--- a/luaotfload.dtx
+++ b/luaotfload.dtx
@@ -560,6 +560,7 @@ require('otfl-font-nms.lua')
 require('otfl-fonts-tfm.lua')
 require('otfl-font-oti.lua')
 require('otfl-font-otf.lua')
+require('otfl-font-pfb.lua')
 require('otfl-font-otb.lua')
 require('otfl-node-inj.lua')
 require('otfl-font-otn.lua')
diff --git a/otfl-basics-gen.lua b/otfl-basics-gen.lua
index c0fc396..0c95d75 100644
--- a/otfl-basics-gen.lua
+++ b/otfl-basics-gen.lua
@@ -80,6 +80,8 @@ local remapper = {
     dfont = "truetype fonts", -- "truetype dictionary",
     cid   = "cid maps",
     fea   = "font feature files",
+    pfa   = "type1 fonts",
+    pfb   = "type1 fonts",
 }
 
 function resolvers.findfile(name,fileformat)
diff --git a/otfl-font-pfb.lua b/otfl-font-pfb.lua
new file mode 100644
index 0000000..66abf23
--- /dev/null
+++ b/otfl-font-pfb.lua
@@ -0,0 +1,8 @@
+local fonts       = fonts
+local readers     = fonts.readers
+
+fonts.formats.pfb = "pfb"
+fonts.formats.pfa = "pfa"
+
+function readers.pfb(specification) return readers.opentype(specification,"pfb","type1") end
+function readers.pfa(specification) return readers.opentype(specification,"pfa","type1") end

Reply via email to