[scribus] automatically size text frame, font metrics Font::TTFMetrics

andrew james andrew at systemssingular.com
Mon Nov 9 20:11:41 CET 2009


Perhaps the intent of my message was obscure. I will reexplain

Malay Basu, wrote a program that he named Font::TTFMetrics, yes the 
language is perl. The code is posted and documented at 
http://search.cpan.org/~malay/Font-TTFMetrics-0.1/lib/Font/TTFMetrics.pm

Though Malay may or may not have concern for the project scribus, I 
copied his address to a previous message. My intent was to connect Malay 
and his code to the project scribus for development of a scribus feature 
that is highly demanded.

Malays program reads units in true type font (ttf) files. An example use 
is to measure character or string widths.

An application of this use is to automate design of a newspaper, that 
requires metrics to size text frames for a limited size page layout.

Currently I found no function in scribus to automatically size text 
frames, am I wrong?


Malays program is simple to use and documented, it is one file at ~1800 
lines of code, approximately half lines are comments, basic dependencies.

Although Malays program is in perl, and I had never wrote perl, I easily 
wrote perl with Malays program to correctly measure character and string 
widths for use in scribus. Some calibration to scribus was necessary.


I recommend Malays program for developers to implement font metrics in 
scribus, that could add some demanded functionality.


Problems with Malays code is that it works with some true type fonts 
only, though it should work for all true type fonts. I reported this 
problem to Malay who replied he will 'look into it and get back' to me. 
I tested two fonts,

DejaVuSerif.ttf - error
georgia.ttf - correct


If anyone wants to use the code that I wrote to semi-automate design 
with scribus send a message. The code is language perl and with module 
Font:TTFMetrics.


andrew




More information about the scribus mailing list