librelist archives

« back to archive

mac os x fonts

mac os x fonts

From:
Dan Croak
Date:
2010-05-18 @ 04:33
Writing my first Shoes apps tonight. One thing I would like is a Font
app. So I wrote this:

https://gist.github.com/d5308131374e05475c3d

It works, except that most of the fonts do not display.

I read in the manual that Mac OS X has trouble with this, that the
font must be loaded beforehand. I tried manually loading all the
ttf/otf/ttc files on my system but that didn't do the trick, either.

Any ideas?

Re: [shoes] mac os x fonts

From:
i5m
Date:
2010-05-18 @ 23:02
This is great! I tried it, I have 800+ fonts installed and it worked with
some quite obscure ones. If I get the time I'll try and see if there is any
pattern to the ones it works with and the ones it doesn't.

For now though, in the console (OSX console that is) I get error messages
like:

18/05/2010 23:52:23 [0x0-0x32c12be].org.hackety.shoes[93102]
(process:93103): Pango-WARNING **: couldn't load font "Apple LiGothic
Medium, Not-Rotated 45.3330078125px", falling back to "Sans Not-Rotated
45.3330078125px", expect ugly output.
18/05/2010 23:52:28 [0x0-0x32c12be].org.hackety.shoes[93102]
(process:93103): Pango-WARNING **: couldn't load font "Arial Bold,
Not-Rotated 45.3330078125px", falling back to "Sans Not-Rotated
45.3330078125px", expect ugly output.
18/05/2010 23:52:36 [0x0-0x32c12be].org.hackety.shoes[93102]
(process:93103): Pango-WARNING **: couldn't load font "Big Caslon Medium,
Not-Rotated 45.3330078125px", falling back to "Sans Not-Rotated
45.3330078125px", expect ugly output.

So could be a Pango issue.

On some it seems it'll display the base font correctly, but not the italics,
bolds, etc.

When you say "except that most of the fonts do not display" I assume you
mean they don't display 'styled' correctly?

-----------------------
i5m.co.uk
GPG Key: 0xA18A602B


On Tue, May 18, 2010 at 5:33 AM, Dan Croak <dcroak@thoughtbot.com> wrote:

> Writing my first Shoes apps tonight. One thing I would like is a Font
> app. So I wrote this:
>
> https://gist.github.com/d5308131374e05475c3d
>
> It works, except that most of the fonts do not display.
>
> I read in the manual that Mac OS X has trouble with this, that the
> font must be loaded beforehand. I tried manually loading all the
> ttf/otf/ttc files on my system but that didn't do the trick, either.
>
> Any ideas?
>

Re: [shoes] mac os x fonts

From:
Satoshi Asakawa
Date:
2010-05-19 @ 14:20
Hi Dan, i5m and folks,

Thank you for sharing very useful code!
I don't have Mac, so can't confirm your problem, sorry.

But I could find my problem for Japanese fonts on Windows.
When I ran your code, I got an error: `not a valid UTF-8 string`.
After some hacking, I found a solution using NKF. ;-)

require 'nkf'

Shoes.app do
 fonts = Shoes::FONTS.collect do |str|
   NKF.nkf('-w', str)
 end

 lb = list_box items: fonts, height: 30
 font = title fonts.first, family: fonts.first

 lb.change do |selected|
   font.text = selected.text
   font.style family: selected.text
 end
end

Thanks again. I can use Japanese fonts now. :)
ashbb

Re: [shoes] mac os x fonts

From:
i5m
Date:
2010-05-19 @ 16:33
Some random thoughts:

What version of Shoes are you using? I'll try and check between 2 and 3
tonight. Could be a problem in Policeman, in either Pango itself, the way it
is built or the way the commands are called.

Could be worth trying building with a development release of Cairo (1.9.6)
and/or Pango to see if that makes a difference.

Found lots of examples of this error Googling, but no decent answer.

Wonder if flags we use to build Cairo are out of date (--enable-quartz=yes
--enable-quartz-font=yes) compared with the Cairo build
instructions<http://cairographics.org/end_to_end_build_for_mac_os_x/>.
Might not make any difference though (might get built this way as default
now).

How does Shoes use Pango? Is it through Cairo, or does it do anything
natively, if so should it be doing this:
http://library.gnome.org/devel/pango/unstable/pango-ATSUI-Fonts.html. Need
to check through the Shoes source code and see if I can figure this out.


-----------------------
i5m.co.uk
GPG Key: 0xA18A602B


On Tue, May 18, 2010 at 5:33 AM, Dan Croak <dcroak@thoughtbot.com> wrote:

> Writing my first Shoes apps tonight. One thing I would like is a Font
> app. So I wrote this:
>
> https://gist.github.com/d5308131374e05475c3d
>
> It works, except that most of the fonts do not display.
>
> I read in the manual that Mac OS X has trouble with this, that the
> font must be loaded beforehand. I tried manually loading all the
> ttf/otf/ttc files on my system but that didn't do the trick, either.
>
> Any ideas?
>

Re: [shoes] mac os x fonts

From:
i5m
Date:
2010-05-19 @ 21:58
Ok, so the same error occurs in Shoes 2 and Shoes 3. That's all I've had
time to check today.
-----------------------
i5m.co.uk
GPG Key: 0xA18A602B


On Wed, May 19, 2010 at 5:33 PM, i5m <i5ivem@googlemail.com> wrote:

> Some random thoughts:
>
> What version of Shoes are you using? I'll try and check between 2 and 3
> tonight. Could be a problem in Policeman, in either Pango itself, the way it
> is built or the way the commands are called.
>
>
>
>
> -----------------------
> i5m.co.uk
> GPG Key: 0xA18A602B
>
>
> On Tue, May 18, 2010 at 5:33 AM, Dan Croak <dcroak@thoughtbot.com> wrote:
>
>> Writing my first Shoes apps tonight. One thing I would like is a Font
>> app. So I wrote this:
>>
>> https://gist.github.com/d5308131374e05475c3d
>>
>> It works, except that most of the fonts do not display.
>>
>> I read in the manual that Mac OS X has trouble with this, that the
>> font must be loaded beforehand. I tried manually loading all the
>> ttf/otf/ttc files on my system but that didn't do the trick, either.
>>
>> Any ideas?
>>
>
>