[squeak-dev] Unicode method returns "?"

Bert Freudenberg bert at freudenbergs.de
Sat Nov 25 13:42:35 UTC 2017


On Sat, Nov 25, 2017 at 2:12 AM, tim Rowledge <tim at rowledge.org> wrote:

> In a trunk image I get a char value 8217 - which is 16r2019, so correct -
> but it renders as a ?. So what we’re almost certainly seeing is a failure
> of the rendering process to find a font glyph with the relevant characters
> included. Which, given the large number of chars needed doesn’t surprise me
> a lot. The rendering does its little dance, finds that there is no glyph in
> the StrikeFont, delegates to the backup font (a Fixed FaceFont in the
> typical case) which has a little think and uses #displayErrorOn:length:at:kern:baselineY:
> to display the ‘substitutionCharacter’ which is ascii 63, or ‘?’.
>

​Yep.​

The only way you’re likely to get the glyph you want would be to use Pango
> rendering via the UnicodePlugin (I think!).
>

​Not the only way. You just need to install a font with all the glyphs you
need:

[image: Inline image 2]

As you can see, it does properly show the single quote as 2019 hex
character, and supports cyrillic (and greek etc too).

For this, I simply downloaded Fira Sans
https://fonts.google.com/download?family=Fira%20Sans and dropped the
unzipped FiraSans-Regular.ttf into Squeak, and chose "Install ttf style".
Then in the Workspace, switch the font to Fira Sans.

That said, our standard font renderer does not know how to deal with
ligatures, RTL, etc, so if you want to support scripts like Arabic or
Devanagari, you indeed need to use a plugin. Scratch uses UnicodePlugin for
rendering, and Etoys on OLPC uses RomePlugin's pango paragraph renderer.

- Bert -​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20171125/65acc824/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2017-11-25 14.30.42.png
Type: image/png
Size: 81936 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20171125/65acc824/attachment-0001.png>


More information about the Squeak-dev mailing list