FreeType2 fonts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gEDA project |
New
|
Wishlist
|
Unassigned | ||
pcb |
New
|
Wishlist
|
Unassigned |
Bug Description
General features
First patches introduce multiple fonts per board; every text
has a pointer to it's font; the font for a new is selected
in the text input window; I also added a field for
the font scale there.
Then different text layouts are introduced.
Texts may be vertical or horizontal; the layout also may be
`reverse': for horizontal layouts this means right-to-left;
for vertical --- donwside-up.
(http://
(the figure shows an optimistic case for a horizontal font turned
vertically: in general, the letters are not adjusted horizontally).
A new font type added, based on FreeType2 library. TTF and Type1
fonts seem to work, PCF don't (most probably, I load them
incorrectly).
Kerning should work for horizontal layouts
(http://
FreeType does not support kerning for vertical layouts,
and actually I have no idea if the implementation may be used
for such scripts.
Glyphs rendering
At first I rendered them with `vertical' lines, like this:
(http://
This was the most simple way, though small characters become
unreadable too soon.
Then I learnt FreeType glyphs had outline structures and
drawed them with lines:
(http://
The next way was to join outlines with fills:
(http://
The `vertical' lines don't fill the outlines very good, some
small spaces remain; probably, something should be adjusted.
At last, I tried to do it with polygons:
(http://
I don't do it clearly, because some contours need to be
added, other subtracted, and it is not evident to me how
to do it in real time.
Besides that, I think lines look more realistic, because
the polygons are not restricted with design rules;
the lines are.
Cyrillic texts
The latest example demostrated a Cyrillic font; the implementation
matches this script quite well; some fonts lacked `ö' glyph;
no other inconveniences.
More examples
Polytonic Greek
(http://
There may be some problems: first, the implementation does not
support combining characters, so there may be difficulties
when entering accented letters; I entered them
via Gnome character map application.
Also, once I could not pull `ü' glyph from a font,
though it was present; probably something wrong
with that font mapping.
Devanagari
(http://
The consonants are not joined into ligatures (this was expected);
however, it puts viramam where it makes sence; it even adds
vowels (much better than I expected).
`i short' is put in a wrong place: I actually wrote
an incorrect sequence to force it hang where it should,
e.g. "-ko(i)va-" instead of "-kovi-".
Afro-Asiatic scripts
(http://
I really can't tell how usable it is for tfel-ot-thgir scripts;
I reproduced a word, I don't know how correctly.
I checked "reverse" checkbox in the text input window and
dragged the letters from Gnome character map.
Some letters take several places in the map; my font accepted
one of them and rejected the rest.
Some notes on usage
To load a font, use LoadFreetype action,
like this: LoadFreetype(
the font list of the current board. Every font in the list
has use counter, it will be embedded when saving the board
if some texts use it.
Different rendering options (outlines, fill, polygons)
are switched with defines in src/ft2font.c
Final remarks
Once I thought whether it would be better to use pango instead
of freetype; it would solve problems with combining character,
but it has the next disadvantages:
first, it is a stronger dependence;
second, it renders to bitmaps only, whereas having
vectored outlines is important when the characters grow small.
These patches can hardly be used in practice,
because they change PCB file format, so mainstream PCB won't
read the files, saved by the patched program.
Changed in pcb: | |
importance: | Undecided → Wishlist |
Changed in geda-project: | |
importance: | Undecided → Wishlist |
The sample boards are hopefully available at ineiev. users.sourcefor ge.net/ pcb/freetype- samples0- 0.tar.gz ineiev. users.sourcefor ge.net/ pcb/freetype- samples0- 1.tar.gz
http://
and
http://