monkey2 icon indicating copy to clipboard operation
monkey2 copied to clipboard

font leading

Open nitrologic opened this issue 7 years ago • 4 comments

To move the look of mojox from "FLTK" to say "QT" I added a fixed 20% leading to the font class and wondering if this attribute may be worth considering.

One issue may be sub pixel blurring if font height starts returning non integer results for some font sizes.

Ideally text should be drawn with y at half lead offset but again this has sub-pixel implications.

more info on leading here - https://en.wikipedia.org/wiki/Leading

leading

nitrologic avatar Apr 10 '18 19:04 nitrologic

The only thing I don't like about this is the fact Font.Height wont be what you asked for in Font.Load, although it may actually explain why it was so hard to get a f$*ing 16px font back in the day.

Do I just need to get over this?

On Wed, Apr 11, 2018 at 7:58 AM, Simon Armstrong [email protected] wrote:

To move the look of mojox from "FLTK" to say "QT" I added a fixed 20% leading to the font class and wondering if this attribute may be worth considering.

One issue may be sub pixel blurring if font height starts returning non integer results for some font sizes.

Ideally text should be drawn with y at half lead offset but again this has sub-pixel implications.

more info on leading here - https://en.wikipedia.org/wiki/Leading http://url

[image: leading] https://user-images.githubusercontent.com/3953439/38580395-ef20ed00-3d5d-11e8-9d27-6d22be440b54.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/blitz-research/monkey2/issues/367, or mute the thread https://github.com/notifications/unsubscribe-auth/ADU3QmWJM0ElQUvIgyux2JjDgHAOXTAyks5tnQ77gaJpZM4TO589 .

blitz-research avatar Apr 10 '18 22:04 blitz-research

An option here would be to leave Font.Height as is and add a Font.TextHeight that includes leading?

On Wed, Apr 11, 2018 at 10:20 AM, Mark Sibly [email protected] wrote:

The only thing I don't like about this is the fact Font.Height wont be what you asked for in Font.Load, although it may actually explain why it was so hard to get a f$*ing 16px font back in the day.

Do I just need to get over this?

On Wed, Apr 11, 2018 at 7:58 AM, Simon Armstrong <[email protected]

wrote:

To move the look of mojox from "FLTK" to say "QT" I added a fixed 20% leading to the font class and wondering if this attribute may be worth considering.

One issue may be sub pixel blurring if font height starts returning non integer results for some font sizes.

Ideally text should be drawn with y at half lead offset but again this has sub-pixel implications.

more info on leading here - https://en.wikipedia.org/wiki/Leading http://url

[image: leading] https://user-images.githubusercontent.com/3953439/38580395-ef20ed00-3d5d-11e8-9d27-6d22be440b54.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/blitz-research/monkey2/issues/367, or mute the thread https://github.com/notifications/unsubscribe-auth/ADU3QmWJM0ElQUvIgyux2JjDgHAOXTAyks5tnQ77gaJpZM4TO589 .

blitz-research avatar Apr 10 '18 22:04 blitz-research

Putting leading attribute in the Font class is possibly a bit unconventional. but yes a Font.TextHeight integral might be good compromise. The wiki page has a bit about the inline box model in html which might be desirable to copy. Note the highlighting of modules node in treeview of screenshot shows the text now needs some vertical offset once leading is introduced.

nitrologic avatar Apr 10 '18 22:04 nitrologic

Like the idea of adding half-leading to top and bottom...

On Wed, Apr 11, 2018 at 10:44 AM, Simon Armstrong [email protected] wrote:

Putting leading attribute in the Font class is possibly a bit unconventional. but yes a Font.TextHeight integral might be good compromise. The wiki page has a bit about the inline box model in html which might be desirable to copy. Note the highlighting of modules node in treeview of screenshot shows the text now needs some vertical offset once leading is introduced.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/blitz-research/monkey2/issues/367#issuecomment-380271069, or mute the thread https://github.com/notifications/unsubscribe-auth/ADU3Qh5P7xCVPoGw1GmnvSNvI-1a5TrBks5tnTXcgaJpZM4TO589 .

blitz-research avatar Apr 10 '18 23:04 blitz-research