[luatex] luatex - font encoding for type 1 fonts

Hans Hagen pragma at wxs.nl
Sat Jun 25 14:47:43 CEST 2016


On 6/25/2016 12:16 PM, Pali Rohár wrote:
> On Friday 24 June 2016 16:11:39 Hans Hagen wrote:
>> On 6/24/2016 3:44 PM, Pali Rohár wrote:
>>> On Friday 24 June 2016 14:10:51 Pali Rohár wrote:
>>>> On Friday 24 June 2016 14:04:13 Hans Hagen wrote:
>>>>> the manual: 1.3.3 Example virtual font
>>>>
>>>> Thank you, going to look at it!
>>>
>>> Now I have something working. If somebody is interesting see
>>> attachment. PDF output from both pdftex and luatex (on pdfcsplain
>>> format) is exactly same.
>>>
>>> Hans & Mojca, it is correct way?
>>
>> you need to do the ligatures and kerns too
>
> Snip from my lua code:
>
> local characters = {}
> for uni, cs in pairs(csbase) do
>         if f.characters[cs] then
>                 characters[uni] = {}
>                 for key, val in pairs(f.characters[cs]) do
>                         characters[uni][key] = val
>                 end
>                 characters[uni].commands = {{ 'char', cs }}
>         end
> end
>
> Inner for loop should copy whole structure of font with ligatures and
> kerns, or not?
>
> Or is something more needed for ligatures and kerns?

you need to remap the kerns hash keys as well as ligatures hash keys O 
chained chars too

>>  > Will hyphenation works correctly?
>>
>> if it's unicoded, yes
>
> New virtual font has defined unicode chars (as commands to other chars),
> so it is unicoded, right?

yes

Anyway, in the next context distribution upload (context also ships with 
a plain variant) I have added a loader script. If you use luaotfload you 
probably have to wait for an update at their end. The luatex-plain 
format that ships with context can do this then:

\font\foo=file:luatex-plain-tfm.lua:tfm=csr10;enc=csr;pfb=csr10 at 12pt

\foo áäčďěíĺľňóôŕřšťúýž fiets ff ffi

\bye

(It uses a few helpers from the existing font code, like cached loading 
and glyph names to unicode mapping using the enc file which saves 
resources and is also more generic than hard coded font vectors. It's 
still a pitty that these csr fonts don't come as a full package like plr 
which has afm files too; in which case the regular afm/pfb loader could 
be used instead. I only tested csr10.tfm / csr10.pfb / css.enc as I 
don't want to install the whole lot.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the luatex mailing list