[why]
In patch set definitions we have for the source ranges SymStart and SymEnd
and for the destination we can specify SrcStart and SrcEnd
The SrcEnd can be automatically generated. For SrcEnd values that differ
from the autogenerated value (are lower) the script would crash, or (are
higher) ignore them anyhow.
There are two modes: 'exact = True' and 'exact = False'.
The SrcStart and SrcEnd values are ignored if exact is True, because the
glyphs are patched into the same codepoint where they originate. This
also means that gaps in the symbols are preserved - all patched in
glyphs have the same codepoint as they have in the source (symbol) font.
When exact is False on the other hand, all (non empty) glyphs are filled
into the codepoints that start at SrcStart. Gaps (empty glyphs) are
ignored and thus are not present as gap in the patched font anymore (*).
The to-be-filled-next codepoint in the patched font just increases by 1
on every filled symbol.
See note for the reason.
This also makes maintining the patch set easier as noone needs to
'calculate' a SrcEnd value anymore.
[how]
Use directly the start value and the counter instead of filling an array
with a range, that is then indexed by the counter.
Before this commit:
list_of_patched_font_codepoints = list(range(SrcStart, SrcEnd + 1))
current_codepoint = list_of_patched_font_codepoints[loop_counter]
After this commit:
current_codepoint = SrcStart + loop_counter
[note]
Maybe related to code removed with c728079.
I guess the code uses the list, because it has been believed that glyphs
can only be indexed by strings containing a hex number. The array
supposedly contained that strings.
But in fact the fontforge python module docu is like this:
font.__getitem__(key)
If key is an integer, then returns the glyph at that encoding.
If a string then returns the glyph with that name.
May not be assigned to.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>