[luatex] Modifying protrusion default.

Philipp Gesang Philipp.Gesang at alumni.uni-heidelberg.de
Mon Aug 26 00:31:07 CEST 2013

···<date: 2013-08-24, Saturday>···<from: john Culleton>···

> I am building a template file series for writers of novels etc. One of
> the strong reasons for using luatex as opposed to other DTP programs is
> the availability of punctuation protrusion. 
> The default protrusion factors are contained in a table in a file named
> otfl-font-dum.lua.

Your Luaotfload version is quite old, you should consider

>                    These factors are too large for use in e.g., a
> novel. I can of course modify this file for my own use. But if I want
> to send the modified file to a client to use is it sufficient to just
> include a modified otfl-font-dum.lua file in the batch of macros I
> send to the customer? Or can I put the modified table in a my luatex
> template source document and expect it to override the original table?
> Or is there another way to use a modified protrusion table that is
> easily transportable to customers who aren't into replacing
> files in the innards of TeX?
I’ve added some example code to the test repo:


This should work with both luaotfload and luatex-fonts.

Basically, your options include a) manipulating the scale factors
of the default vector or b) making up your own vector. New
vectors, if added to the table fonts.protrusions.setups, can be
referred to by their name when defining a font just like the
default. E. g. create a vector

    fonts.protrusions.setups.myvector = {
      factor = 1,
      left   = 1,
      right  = 1,

      --- map code points to protrusion values
      --- [1] is  left, [2] is right
      [string.byte ","] = { 0, 0.4 },
      [string.byte "."] = { 0, 0.4 },

and then in your document define a font like so:

  \font \mainfont = "file:Iwona-Regular.otf:protrusion=myvector"

It’s not hard, except for coming up with sane values ;-)

Best regards,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://tug.org/pipermail/luatex/attachments/20130826/409189cd/attachment.bin>

More information about the luatex mailing list