Font issues
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Font issues
What is the best font to use generally cross platform.
I have been using Arial which has worked across Windows and Mac OK, but with v2.9 Ive just compiled to Linux and tested on Ubuntu and Arial just blows a lot of the text out of the boxes (too wide)
Any ideas on an Arial like font that will work?
Andy
I have been using Arial which has worked across Windows and Mac OK, but with v2.9 Ive just compiled to Linux and tested on Ubuntu and Arial just blows a lot of the text out of the boxes (too wide)
Any ideas on an Arial like font that will work?
Andy
OK, im a little further with this!
Using the fontnames property I can find out which fonts are on the system and choose a substitute font.
Ive tried just setting the stack to that font so it filters down to all the controls, but the stacks have lots (and lots) of predetermined fints in them, so most controls are staying in Arial.
Is there an easy way to say 'if the platform is linux set the fontstyle of all the fields to xyz' rather than doing them one by one?
Here is the code im using to find the fonts...
Using the fontnames property I can find out which fonts are on the system and choose a substitute font.
Ive tried just setting the stack to that font so it filters down to all the controls, but the stacks have lots (and lots) of predetermined fints in them, so most controls are staying in Arial.
Is there an easy way to say 'if the platform is linux set the fontstyle of all the fields to xyz' rather than doing them one by one?
Here is the code im using to find the fonts...
Code: Select all
if the platform is "Linux" then
global LinuxFontName
if "Arial" is among the lines of the fontNames then
put "Arial" into LinuxFontName
else if "Helvetica" is among the lines of the fontNames then
put "Helvetica" into LinuxFontName
else if "Freesans" is among the lines of the fontNames then
put "Freesans" into LinuxFontName
else if "charter" is among the lines of the fontNames then
put "Garuda" into LinuxFontName
else
-- code the ask user to install a font
end if
Thanks Mark, my app is going to be shareware so I wasnt sure if I could use that font unless it was a free app.
Ive found some more code to get all the fields in a stack, so Im working on some code that rips through the form on a preopenstack if the platform is Linux and changes all the fields to a font that is present on the system, in the order that I prefer, basically substituting Arial with something else that works.
Not ideal, but if it works it will be fine, and if it works Ill post the code in case its useful to anyone else.
Thanks again.
Andy
Ive found some more code to get all the fields in a stack, so Im working on some code that rips through the form on a preopenstack if the platform is Linux and changes all the fields to a font that is present on the system, in the order that I prefer, basically substituting Arial with something else that works.
Not ideal, but if it works it will be fine, and if it works Ill post the code in case its useful to anyone else.
Thanks again.
Andy
Here is the code Ive collected from around the web, if anyone has any suggestions to make it better it would be appreciated!
Andy
Andy
Code: Select all
on doSetFonts mystackname
local i,j, IDtracker, Linuxfontname
if the platform is "Linux" then
-- Check which fonts are available
if "Arial" is among the lines of the fontNames then
put "Arial" into LinuxFontName
else if "Helvetica" is among the lines of the fontNames then
put "Helvetica" into LinuxFontName
else if "Freesans" is among the lines of the fontNames then
put "Freesans" into LinuxFontName
else if "charter" is among the lines of the fontNames then
put "Garuda" into LinuxFontName
else
set the textfont of stack mystackname to empty
answer "None of the standard fonts were available, please install the Bitstream Vera Sans font to ensure the software displays correctly on this machine."
exit doSetFonts
end if
put empty into theFieldList
put empty into IDtracker
set the wholeMatches to true
repeat with i = 1 to the number of cards of stack mystackname
-- Alter fields to selected font
repeat with j = 1 to the number of fields of card i of stack mystackname
if lineOffset ((the short id of field j of card i of stack mystackname),IDTracker) <> 0 then next repeat
set the textfont of (the long id of field j of card i of stack mystackname) to LinuxFontName
end repeat
-- Alter buttons to selected font
repeat with j = 1 to the number of buttons of card i of stack mystackname
if lineOffset ((the short id of button j of card i of stack mystackname),IDTracker) <> 0 then next repeat
set the textfont of (the long id of button j of card i of stack mystackname) to LinuxFontName
end repeat
end repeat
end if
end doSetFonts
Solution
Did anyone find a acceptable solution to this? Courier New is what I have been using but is seems there is documentation to the contrary.
http://www.codestyle.org/css/font-famil ... ults.shtml
http://www.codestyle.org/css/font-famil ... ults.shtml
Kevin,
What's with the link? All I see is a graph that confirms that everybody has that unusable font Courier New installed. I very much dislike that font.
Mark
P.S. I just didn't want to use the word "hate" ;-)
What's with the link? All I see is a graph that confirms that everybody has that unusable font Courier New installed. I very much dislike that font.
Mark
P.S. I just didn't want to use the word "hate" ;-)
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Agree
The link was meant to assist in picking a reliable multi-platform font. The suggestion of Courier New/Courier is just something I settled on (not a real preference of any kind just found it useful). I am unclear on exactly how to set the default font to any specific selection for a particular platform (without looping the controls). I hopped that some one might have found a better solution.
Kevin
Kevin
Hi Kevin,
The fact that a font is cross-platform isn't enough. It should also be feasible as an interface font. Btw what do you consider an acceptable solution?
Andy: I would loop over the number of controls, using one loop, instead of using a loop for fields and one for buttons. I think that the ID tracker got a bit orphaned in your script.
Best,
Mark
The fact that a font is cross-platform isn't enough. It should also be feasible as an interface font. Btw what do you consider an acceptable solution?
Andy: I would loop over the number of controls, using one loop, instead of using a loop for fields and one for buttons. I think that the ID tracker got a bit orphaned in your script.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode