Font used in display dialog text

Subject says it all. What font does the system use in the text of a display dialog “some text” statement?

Lucida grande 13 pt

Hi Adam
looks like stefan beat me to it, but i was gonna say Helvetica or Lucida grande.
i’m sure its one of them.

danke, thanks :slight_smile:

On further thought, that’s interesting because when you specify some Unicode text as I have in the example below it works even though the characters are not in the Lucinda Grande font.

display dialog «data utxt2661266326622660» as Unicode text

Obviously, the system “figures it out” and finds the font that does have those characters. Interesting to know what the rules were. This doesn’t work, however, if the font is not system-supplied - i.e. some of the mathematical fonts for extending brackets that come with MathType.

Adam

Adam,

Funny.
I was trying out how to get the Apple symbol (and maybe others) in some meaningful way:


set l to 2600
repeat
set l to l + 1
	set k to («data utxt & l & "»") as Unicode text)
	display dialog "hello: " & k
end repeat

but this does no coerce very well.
Any idea of how to get this work…?

If by the apple symbol you mean the little clover leaf:

display dialog «data utxt2318» as Unicode text

-- and I like this one:

display dialog «data utxt2981» as Unicode text

but I discovered all of those I know by rolling through the Character Palette.

Okay how about the “real” Apple logo?

I see a lot of Google hits saying Apple never submitted it for Unicode inclusion, that it was shoehorned into one of the “Private Use” sets, etc., etc. Then I see on MacRumors forums that their BBS supports it but apparently there are more than a few hoops to jump through, raw-HTML-code wise, to get it to display as desired there. I’m just curious where in the Character Palette I should go looking and what the likelihood is that I’ll find it. I’d much rather have a solid Apple in a dialog box than what I’ve heard called the “curly-Q” or the “cloverleaf” (as in highway).

Silversleeves

display dialog «data utxtF8FF» as Unicode text --> 

Theoretically, it’s «data utxtF0E7» as Unicode text as well, but unfortunately, like all “private” font characters, it shows up in some other font. I’ve had the same problem trying to use some of the mathematical symbols. AppleScript doesn’t give you a way to specify the font you’re referring to (that I’ve ever discovered) when the code refers to symbols in more than one font as this one does.

Thanks, Stefan for finding one that works.

By the way: on an Apple Computer it’s also ASCII character 240


display dialog (ASCII character 240) --> 

Thank you, Stefan and Adam.

Silversleeves

What would be the code for a right-arrow…?
(How did you get these codes, anyway…?)

Hi Eelco,

right arrow is

display dialog «data utxt2192» as Unicode text

left: 2190, down: 2193, up: 2191

You can get all these codes from Character Palette oder with tools like PopChar

The same font seems to be used for the text field in a dialog.
i.e.

display dialog «data utxt2661266326622660» as Unicode text default answer «data utxt2661266326622660» as Unicode text

Copying its contents into TextEdit, it appears that the font used for those particular characters is Hiragino Kaku Gothic Pro (well, at least for me).

Also, on my system, I can use the key combo option-shift-k to produce a . ( << It’ll be interesting to know what this looks like on a PC :wink: )

Thanks, Stefan.
I’d say the following script should also work:


repeat with i from 2318 to 2981
	set r to ("«data utxt" & i  & "»") as Unicode text
	display dialog r
end repeat

…but it doesn’t.

Could it be that the Unicode text definition includes font spec and has priority over the default font?

It works with second-level evaluation :slight_smile:

repeat with i from 2318 to 2981
	set r to run script ("«data utxt" & i & "»") as Unicode text
	display dialog r
end repeat

Hi guys.

Actually, since a dialog renders everything as Unicode text anyway, you can get away without an explicit coercion here:


repeat with i from 2318 to 2981
	display dialog (run script "«data utxt" & i & "»")
end repeat


Of course, viewing each character in that way might take a little while…

… although I suppose you could always display them all in one hit:


set {min, max} to {2318, 2981}

on chunk from b to e
	set l to {}
	repeat with i from b to e
		set l's end to i
	end repeat
	l as string
end chunk
set text item delimiters to {""}
if max - min < 63 then
	set {l, r} to {{chunk from min to max}, ""}
else
	set {l, r} to {{}, " & "}
	repeat with i from min + 62 to max by 63
		set l's end to chunk from i - 62 to i
	end repeat
	tell i + 1 to if it ≤ max then set l's end to my (chunk from it to max)
end if
set text item delimiters to "»" & return & "«data utxt"
set l to ("«data utxt" & l & "»")'s paragraphs
set text item delimiters to " & "
tell l to set s to beginning & " as unicode text" & r & rest
set text item delimiters to {""}
display dialog (run script s)


Fairly good.
However,


repeat with i from 2318 to 2981
	display dialog run script ("«data utxt" & i & "»") -- either as Unicode text or not
end repeat

does not always work with me:
the first instance (command-char) gets lost…!

Eelco; That works for me including the Command symbol. Can this be a language settings problem? It works for me in French too, but I haven’t changed keyboards, of course.