Athens Font Rendering Bug

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

Athens Font Rendering Bug

jrick
Perhaps other people have already reported this for Bloc but something is wrong with the font rendering of Athens. Here's the code and how it is rendered in Athens vs how it is rendered in BitBlt. It seems like Athens adds more space between letters than is supposed to be there.

tMorph := TextMorph new.
font1 := TextFontReference toFont: (LogicalFont familyName: 'Arial' fallbackFamilyNames: nil pointSize: 28 stretchValue: 5 weightValue: 400 slantValue: 0).
font2 := (TextFontReference toFont: (StrikeFont familyName: 'Atlanta' size: 11)).
t1 := 'this is font1' asText addAttribute: font1.
t2 := ' and this is font2' asText addAttribute: font2.
tMorph contents: (t1,t2).

Cheers,

Jeff

AthensRenderingOfFonts.png (3K) Download Attachment
NormalRenderingOfFonts.png (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Athens Font Rendering Bug

Aliaksei Syrel

Hi

Actually it is not Athens bug. Problem is in string extent measurement done by text morph. Athens (Cairo in the end) only renders string glyphs created by FreeType2 on positions specified by someone else (morphic in this case).

Cheers
Alex

On Jul 10, 2016 6:16 PM, "J.F. Rick" <[hidden email]> wrote:
Perhaps other people have already reported this for Bloc but something is wrong with the font rendering of Athens. Here's the code and how it is rendered in Athens vs how it is rendered in BitBlt. It seems like Athens adds more space between letters than is supposed to be there.

tMorph := TextMorph new.
font1 := TextFontReference toFont: (LogicalFont familyName: 'Arial' fallbackFamilyNames: nil pointSize: 28 stretchValue: 5 weightValue: 400 slantValue: 0).
font2 := (TextFontReference toFont: (StrikeFont familyName: 'Atlanta' size: 11)).
t1 := 'this is font1' asText addAttribute: font1.
t2 := ' and this is font2' asText addAttribute: font2.
tMorph contents: (t1,t2).

Cheers,

Jeff
Reply | Threaded
Open this post in threaded view
|

Re: Athens Font Rendering Bug

jrick
Interesting. Why is it then correct in BitBlt rendering and not correct in Athens rendering? Does this mean it can be fixed at the Smalltalk level? If so, give me a hint of where to look and I'll see if I can find a solution.

Cheers,

Jeff

On Sun, Jul 10, 2016 at 1:12 PM Aliaksei Syrel <[hidden email]> wrote:

Hi

Actually it is not Athens bug. Problem is in string extent measurement done by text morph. Athens (Cairo in the end) only renders string glyphs created by FreeType2 on positions specified by someone else (morphic in this case).

Cheers
Alex

On Jul 10, 2016 6:16 PM, "J.F. Rick" <[hidden email]> wrote:
Perhaps other people have already reported this for Bloc but something is wrong with the font rendering of Athens. Here's the code and how it is rendered in Athens vs how it is rendered in BitBlt. It seems like Athens adds more space between letters than is supposed to be there.

tMorph := TextMorph new.
font1 := TextFontReference toFont: (LogicalFont familyName: 'Arial' fallbackFamilyNames: nil pointSize: 28 stretchValue: 5 weightValue: 400 slantValue: 0).
font2 := (TextFontReference toFont: (StrikeFont familyName: 'Atlanta' size: 11)).
t1 := 'this is font1' asText addAttribute: font1.
t2 := ' and this is font2' asText addAttribute: font2.
tMorph contents: (t1,t2).

Cheers,

Jeff
Reply | Threaded
Open this post in threaded view
|

Re: Athens Font Rendering Bug

HilaireFernandes
In reply to this post by Aliaksei Syrel
Not sure it is related, but I found bug in Dr. Geo when rendering
string, the whole text extent does not seem right and glitches appear,

See the picture attached to this bug report:
https://bugs.launchpad.net/drgeo/+bug/1372933

Hilaire

Le 10/07/2016 19:10, Aliaksei Syrel a écrit :

> Hi
>
> Actually it is not Athens bug. Problem is in string extent measurement
> done by text morph. Athens (Cairo in the end) only renders string glyphs
> created by FreeType2 on positions specified by someone else (morphic in
> this case).
>
> Cheers
> Alex
>

--
Dr. Geo
http://drgeo.eu


Reply | Threaded
Open this post in threaded view
|

Re: Athens Font Rendering Bug

Henrik Nergaard
On Windows?

Try:
-----
CairoGlyph class removeSelector:#byteAlignment.
CairoGlyph rebuildFieldAccessors .
----

Best regards,
Henrik

-----Original Message-----
From: Pharo-dev [mailto:[hidden email]] On Behalf Of Hilaire
Sent: Tuesday, July 12, 2016 11:00 AM
To: [hidden email]
Subject: Re: [Pharo-dev] Athens Font Rendering Bug

Not sure it is related, but I found bug in Dr. Geo when rendering string, the whole text extent does not seem right and glitches appear,

See the picture attached to this bug report:
https://bugs.launchpad.net/drgeo/+bug/1372933

Hilaire

Le 10/07/2016 19:10, Aliaksei Syrel a écrit :

> Hi
>
> Actually it is not Athens bug. Problem is in string extent measurement
> done by text morph. Athens (Cairo in the end) only renders string
> glyphs created by FreeType2 on positions specified by someone else
> (morphic in this case).
>
> Cheers
> Alex
>

--
Dr. Geo
http://drgeo.eu


Reply | Threaded
Open this post in threaded view
|

Re: Athens Font Rendering Bug

jrick
In reply to this post by jrick
It seems that emphasis is also not respected in Athens. If I try the following, it works in BitBlt, but both are rendered as plain inside Athens.

| font boldFont |
font := StrikeFont familyName: 'Arial' pointSize: 18.
boldFont := StrikeFont familyName: 'Arial' pointSize: 18 emphasized: TextEmphasis bold emphasisCode.
TextMorph new
contents: (Text initialFont: font stringOrText: 'test'), (Text initialFont: boldFont stringOrText: 'this');
openInHand
Reply | Threaded
Open this post in threaded view
|

Re: Athens Font Rendering Bug

Nicolai Hess-3-2

Do not use StrikeFont with athens


Am 20.07.2016 7:49 nachm. schrieb "J.F. Rick" <[hidden email]>:
It seems that emphasis is also not respected in Athens. If I try the following, it works in BitBlt, but both are rendered as plain inside Athens.

| font boldFont |
font := StrikeFont familyName: 'Arial' pointSize: 18.
boldFont := StrikeFont familyName: 'Arial' pointSize: 18 emphasized: TextEmphasis bold emphasisCode.
TextMorph new
contents: (Text initialFont: font stringOrText: 'test'), (Text initialFont: boldFont stringOrText: 'this');
openInHand
Reply | Threaded
Open this post in threaded view
|

Re: Athens Font Rendering Bug

jrick
Cool. What should I use? Is this useful: http://www.tudorgirba.com/blog/free-font-collection-for-pharo

On Wed, Jul 20, 2016 at 2:16 PM Nicolai Hess <[hidden email]> wrote:

Do not use StrikeFont with athens


Am 20.07.2016 7:49 nachm. schrieb "J.F. Rick" <[hidden email]>:
It seems that emphasis is also not respected in Athens. If I try the following, it works in BitBlt, but both are rendered as plain inside Athens.

| font boldFont |
font := StrikeFont familyName: 'Arial' pointSize: 18.
boldFont := StrikeFont familyName: 'Arial' pointSize: 18 emphasized: TextEmphasis bold emphasisCode.
TextMorph new
contents: (Text initialFont: font stringOrText: 'test'), (Text initialFont: boldFont stringOrText: 'this');
openInHand
Reply | Threaded
Open this post in threaded view
|

Re: Athens Font Rendering Bug

Nicolai Hess-3-2


2016-07-20 20:46 GMT+02:00 J.F. Rick <[hidden email]>:
Cool. What should I use? Is this useful: http://www.tudorgirba.com/blog/free-font-collection-for-pharo

Any FreeType font, the builtin (Source Sans Pro/ Source Code Pro) or a font from your system (after loading all available fonts).

| font boldFont italicFont |
font := LogicalFont familyName: 'Source Sans Pro' pointSize: 18.
boldFont := (LogicalFont familyName: 'Arial' pointSize: 18) emphasized: TextEmphasis bold emphasisCode.
italicFont := (LogicalFont familyName: 'Times New Roman' pointSize: 18) emphasized: TextEmphasis italic emphasisCode.
TextMorph new
    contents: (Text initialFont: font stringOrText: 'normal'), (Text initialFont: boldFont stringOrText: 'bold'), (Text initialFont: italicFont stringOrText: 'italic');
    openInSceneView
 

On Wed, Jul 20, 2016 at 2:16 PM Nicolai Hess <[hidden email]> wrote:

Do not use StrikeFont with athens


Am 20.07.2016 7:49 nachm. schrieb "J.F. Rick" <[hidden email]>:
It seems that emphasis is also not respected in Athens. If I try the following, it works in BitBlt, but both are rendered as plain inside Athens.

| font boldFont |
font := StrikeFont familyName: 'Arial' pointSize: 18.
boldFont := StrikeFont familyName: 'Arial' pointSize: 18 emphasized: TextEmphasis bold emphasisCode.
TextMorph new
contents: (Text initialFont: font stringOrText: 'test'), (Text initialFont: boldFont stringOrText: 'this');
openInHand

Reply | Threaded
Open this post in threaded view
|

Re: Athens Font Rendering Bug

jrick
Thanks. It is working nicely.

On Wed, Jul 20, 2016 at 3:32 PM Nicolai Hess <[hidden email]> wrote:
2016-07-20 20:46 GMT+02:00 J.F. Rick <[hidden email]>:
Cool. What should I use? Is this useful: http://www.tudorgirba.com/blog/free-font-collection-for-pharo

Any FreeType font, the builtin (Source Sans Pro/ Source Code Pro) or a font from your system (after loading all available fonts).

| font boldFont italicFont |
font := LogicalFont familyName: 'Source Sans Pro' pointSize: 18.
boldFont := (LogicalFont familyName: 'Arial' pointSize: 18) emphasized: TextEmphasis bold emphasisCode.
italicFont := (LogicalFont familyName: 'Times New Roman' pointSize: 18) emphasized: TextEmphasis italic emphasisCode.
TextMorph new
    contents: (Text initialFont: font stringOrText: 'normal'), (Text initialFont: boldFont stringOrText: 'bold'), (Text initialFont: italicFont stringOrText: 'italic');
    openInSceneView
 

On Wed, Jul 20, 2016 at 2:16 PM Nicolai Hess <[hidden email]> wrote:

Do not use StrikeFont with athens


Am 20.07.2016 7:49 nachm. schrieb "J.F. Rick" <[hidden email]>:
It seems that emphasis is also not respected in Athens. If I try the following, it works in BitBlt, but both are rendered as plain inside Athens.

| font boldFont |
font := StrikeFont familyName: 'Arial' pointSize: 18.
boldFont := StrikeFont familyName: 'Arial' pointSize: 18 emphasized: TextEmphasis bold emphasisCode.
TextMorph new
contents: (Text initialFont: font stringOrText: 'test'), (Text initialFont: boldFont stringOrText: 'this');
openInHand