On 12.11.2012 21:18, Stéphane Ducasse wrote:
I thought it should work :(
Yes and no.
Pharo is fully capable of displaying it, as long as it's part of the font:
https://dl.dropbox.com/u/6751081/UniSymbol.PNG
What it does not (currently) do, but built in rendering systems usually
do, is search for and use other fonts if the currently selected one does
not contain it.
With a font parser (TTFontReader was removed in 2.0, I think?) I think
it would be possible to implement such functionality rather efficiently,
I don't see the same happening if one tries the same using the
FT-plugin, which would probably require loading each font face, then
attempt to load the character and check for errors (where, I am not sure)
Cheers,
Henry
PS. For those wondering, I did not search through all Windows fonts
manually.
PopChar is a neat utility that easily lets you search for which fonts
actually contain glyphs for a given character. (available for MacOS too)
I was playing with the following:
http://en.wikipedia.org/wiki/Chess_symbols_in_Unicode
'/tmp/chess.txt' asFileReference writeStreamDo: [ :stream |
(16r2654 to: 16r265F)
do: [ :each |
stream nextPut: each asCharacter ]
separatedBy: [ stream space ].
stream crlf ].
$ cat /tmp/chess.txt
♔ ♕ ♖ ♗ ♘ ♙ ♚ ♛ ♜ ♝ ♞ ♟
(this shows for me, in my terminal/mail, YMMV ;-)
String streamContents: [ :stream |
(16r2654 to: 16r265F)
do: [ :each |
stream nextPut: each asCharacter ]
separatedBy: [ stream space ].
stream crlf ].
Is there a way to make this work, a font selection that show these Unicode
characters in Pharo ? That would be cool.
I tried using Freetype font Monaco, the same as my terminal where the right
characters show, but that didn't help.
Sven
--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill