The Trunk: TrueType-mt.52.mcz

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

The Trunk: TrueType-mt.52.mcz

commits-2
Marcel Taeumel uploaded a new version of TrueType to project The Trunk:
http://source.squeak.org/trunk/TrueType-mt.52.mcz

==================== Summary ====================

Name: TrueType-mt.52
Author: mt
Time: 20 August 2019, 3:35:06.793246 pm
UUID: 6fb23ce7-780d-784a-96ab-4b108da4c7da
Ancestors: TrueType-pre.51

Fixes TTCFont-to-TextStyle detection, which makes EtoysTheme look better.

Note that Squeak's management of fonts and text styles and text-font changes and text-font references is kind of ugly. :-)

=============== Diff against TrueType-pre.51 ===============

Item was changed:
  ----- Method: TTCFont>>textStyle (in category 'accessing') -----
  textStyle
 
+ | styles |
+ styles := TextStyle actualTextStyles.
+
+ ^ (styles includesKey: self name)
+ ifTrue: [styles at: self name]
+ ifFalse: [
+ "Fallback: Maybe this font is in a text style with another name?"
+ styles
+ detect: [:aStyle | aStyle fontArray anySatisfy: [:font | font name = self name]]
+ ifNone: [nil]]!
- ^ TextStyle actualTextStyles
- detect: [:aStyle | (aStyle fontArray collect: [:s | s name]) includes: self name]
- ifNone: [nil]!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: TrueType-mt.52.mcz

timrowledge


> On 2019-08-20, at 6:35 AM, [hidden email] wrote:
> Squeak's management of fonts and text styles and text-font changes and text-font references is kind of ugly. :-)

That is very much an understatement. I wish we could do better

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
"Bother!" said Pooh, as he pulled Piglet out the mincer.



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: TrueType-mt.52.mcz

Tobias Pape

> On 20.08.2019, at 18:54, tim Rowledge <[hidden email]> wrote:
>
>
>
>> On 2019-08-20, at 6:35 AM, [hidden email] wrote:
>> Squeak's management of fonts and text styles and text-font changes and text-font references is kind of ugly. :-)
>
> That is very much an understatement. I wish we could do better

If I just had some time…

>
> tim




Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: TrueType-mt.52.mcz

timrowledge


> On 2019-08-20, at 9:56 AM, Tobias Pape <[hidden email]> wrote:
>
>
>> On 20.08.2019, at 18:54, tim Rowledge <[hidden email]> wrote:
>>
>>
>>
>>> On 2019-08-20, at 6:35 AM, [hidden email] wrote:
>>> Squeak's management of fonts and text styles and text-font changes and text-font references is kind of ugly. :-)
>>
>> That is very much an understatement. I wish we could do better
>
> If I just had some time…

Yeah, I hear you.

One simple approach you could try playing with is the code I did for NuScratch. That (and it was very Raspberry Pi focussed, so may be a problem elsewhere)used Cairo/Pango plugins to render strings to a form and then copied the form to the display. Now it's important to remember that this was almost entirely for small chunks of text, rarely more than a few words, but even on an original Pi it was perfectly good performance. You'd find the code in the NuScratch package on squeaksource (in SM too) and the unicode plugin and maybe the scratch plugin.


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful random insult:- Forgot to pay his brain bill.



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: TrueType-mt.52.mcz

Tobias Pape
Hi

> On 20.08.2019, at 19:00, tim Rowledge <[hidden email]> wrote:
>
>
>
>> On 2019-08-20, at 9:56 AM, Tobias Pape <[hidden email]> wrote:
>>
>>
>>> On 20.08.2019, at 18:54, tim Rowledge <[hidden email]> wrote:
>>>
>>>
>>>
>>>> On 2019-08-20, at 6:35 AM, [hidden email] wrote:
>>>> Squeak's management of fonts and text styles and text-font changes and text-font references is kind of ugly. :-)
>>>
>>> That is very much an understatement. I wish we could do better
>>
>> If I just had some time…
>
> Yeah, I hear you.
>
> One simple approach you could try playing with is the code I did for NuScratch. That (and it was very Raspberry Pi focussed, so may be a problem elsewhere)used Cairo/Pango plugins to render strings to a form and then copied the form to the display. Now it's important to remember that this was almost entirely for small chunks of text, rarely more than a few words, but even on an original Pi it was perfectly good performance. You'd find the code in the NuScratch package on squeaksource (in SM too) and the unicode plugin and maybe the scratch plugin.

I've seen the NuScratch way, I think we even chatted about it.

Pain is: Pango/Cairo is not thaaaat easy to do platform-independently.

We also had some students who did something like that. maybe we can resurrect that code…

I think having at least HarfBuzz and Freetype for lowlevel stuff would be beneficial
(it's what Pango uses, too, after all). And I think HarfBuzz is imperative if we
ever what to truly support anything beyond latin.

Best regards
        -Tobias