What is a good test suite for fonts?
There are some serious bugs to repair.
And I need to insure I am making matters better not worse.
The struggle right now is with TTCFonts and how they init and use ascent.
The relation between TTCFonts, StrikeFonts and fallbackFonts.
And how fallback fonts are used and modified in both classes.
StrikeFont>>ascent is a simple accessor for the ivar assent.
TTCFont>>ascent is not simple.
It depends on the value of fallBackFont ascent.
And in most squeaks it is writen such that
it will infinitely recurse if fallBackFont baseFont is the same as self.
And there are many use cases where this is exactly what it should be.
(E.G the fall back is a fixedFace (one glyph) errorfont
showing a ? when an font character is missing from the active font.
The ? will look best if it is the glyph from the active font.)
It is possible to rewrite TTCFont>>ascent so that,
while still recursive, avoids the infinite recursion.
The other (imo) preferred fix is to return ascent to a simple accessor
and set about to insure it is initialized at all times to a proper value.
The problem is it seems that the ascent must be
the larger of the calculated ascent for the font
and the fallbackfonts ascent.
So it would seem that the place to catch this
would be where fallbackFont: is sent to set the font.
The problem is that the mutator is sidestepped in many
of the strikefont methods
and the ivar is modified directly
including by the fallbackFont accessor
which does lazy initialization to insure
an undefined fallback becomes the fixedFont errorfont.
If the above sentence makes you dizzy,
then you know how I've fell while tracking this down.
Needless to say I am thinking this is whack.
Squeak goes out of its way to tie its shoelaces together as it were.
So questions.
1) In practice is there a use case where the fallbackFont is not just a fixedFacedFont error font?
2) In practice is there a use case where a fonts error gylph should not look like its own questionmark ?
3) Is it really important that the fallbackfont ascent take precedence over the TTCFont ascent?
4) Why is (3) not true for StrikeFonts as well?
======
5) If I tackle this repair how do I assure I am making matters better not worse?
Last and first) What is a good test suite for fonts?
Yours in curiosity and service, --Jerome Peace
References:
http://bugs.squeak.org/view.php?id=66640006664: TTCFont>ascent can be infinitely recursive.
and please look at the related issues!