Font handling

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Font handling

Karl Ramberg
Hi,
the current font handling could need a refactoring/ cleanup.
Emphasis of a font are stored in different places and that makes it inconsistent and very hard to interface.

As far as I can tell should the emphasis info be stored as a text attribute.
But it seems that many tools set the emphasis directly in the font.

Here is a couple of examples from text in Workspaces:

{a TextEmphasis code: 1 . aTextFontReference(TTCFont(BitstreamVeraSansMono 24 Bold Oblique))}
This font has bold and italics set in the font (corresponds to value 3), but the emphasis attribute is 1 which corresponds to bold.

{a TextFontReference(a StrikeFont(Accumon10 12))}
Here is also emphasis set in the font and no emphasis attribute is present at all.


Karl


Reply | Threaded
Open this post in threaded view
|

Re: Font handling

Karl Ramberg
I have taken a look at TextMorph textStyle which seem superfluous. All textStyle is either handled by the paragraph or the the runs in Text. 
It seems we can replace all references to TextMorph textStyle instance variable to paragraph textstyle without any side effects.
But I guess we must keep the instance variable for backwards compability.

On Thu, Apr 30, 2015 at 2:29 PM, karl ramberg <[hidden email]> wrote:
Hi,
the current font handling could need a refactoring/ cleanup.
Emphasis of a font are stored in different places and that makes it inconsistent and very hard to interface.

As far as I can tell should the emphasis info be stored as a text attribute.
But it seems that many tools set the emphasis directly in the font.

Here is a couple of examples from text in Workspaces:

{a TextEmphasis code: 1 . aTextFontReference(TTCFont(BitstreamVeraSansMono 24 Bold Oblique))}
This font has bold and italics set in the font (corresponds to value 3), but the emphasis attribute is 1 which corresponds to bold.

{a TextFontReference(a StrikeFont(Accumon10 12))}
Here is also emphasis set in the font and no emphasis attribute is present at all.


Karl