Re: Embedding fonts anomalies
on Sun, 16 Nov 2008 14:07:58 -0500 Shari wrote: No, but here's the code I am using, and it appears to be working: snip Great! i am going to test your code in Windows and Ubuntu Linux and tomorrow will report the results. Thanks again for posting your work! alejandro ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Embedding fonts anomalies
Apologies, no, Alejandro. I am experimenting with this for the first time and after reading the archives of the problems others have encountered, am trying to foresee problems and solve them in advance. No idea if my idea is a good one or will solve the problems others have described, though I'm expecting it should solve one... choosing a font that actually exists (or that you've successfully loaded). So I put forth what I hoped was a solution. If others had tried similar things or found better solutions, perhaps they would post them. But you are the only one who responded so far. All I know is that after reading thru various older postings about embedding fonts, there appeared to be gotchas and I did not find posts that solved the gotchas, only posts that defined them. And one wouldn't know if they had a gotcha until deploying on many machines. Off I go to play with my fonts... :-) Shari hi Shari, i have not used this feature, but it is really mind opening to see, how developers use font embedding in their apps. Do you have a sample stack that show the approach that you described? Thanks in advance! alejandro Shari-2 wrote: Load several custom fonts. Create a heirarchy of first choice, second choice, etc. If firstChoice is in the fontNames then set the fields to it. Else move to secondChoice, thirdChoice, etc., ending with several fonts that should already be installed on user systems as a last resort. -- Dogs and bears, sports and cars, and patriots t-shirts http://www.villagetshirts.com WlND0WS and MAClNT0SH shareware games http://www.gypsyware.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Embedding fonts anomalies
Do you have a sample stack that show the approach that you described? No, but here's the code I am using, and it appears to be working: on loadGameFonts global gameFonts # gameFonts is the folder that holds several custom fonts set the directory to gameFonts put the files into fileList filter fileList with *.ttf # delete all non-ttf-font files repeat for each line x in fileList put gameFonts / x into theFont revFontLoad theFont end repeat # now all the fonts are loaded and can be used in Rev # in case a font doesn't load for whatever reason, # cycle thru the fonts as a heirarchy, setting the font # of the stack to firstChoice, secondChoice, thirdChoice, etc. # set font heirarchy using the name of the font as # it appears in the fontNames, as the fontNames may contain # several variations of a font and I want a very specific variation, # I put the full, unedited name of the font I want # The following is an example, these are not the actual fonts I used # The dash-number will set the font size as each font may require a # different font size to give a similar size result put Arial-20,Trebuchet Bold-18,Goudy Old Style-24,Big Caslon-20,Lucida Bright-18 into tit set the wholeMatches to true # so that it doesn't match plain old Trebuchet to Trebuchet Bold repeat for each item x in tit set the itemDel to - if item 1 of x is among the lines of the fontNames then set the textFont of stack nameOfMainStack to \ item 1 of x set the textSize of stack nameOfMainStack to \ item 2 of x exit repeat end if set the itemDel to comma end repeat # none of the fields have a font set so they will use the font of the stack itself # the only issue needing to be resolved is that you cannot set the line height of a stack # so if you want that to change depending on the font chosen, you'll need to # do some sort of handler to change the line height of each specific field based on # the font end loadGameFonts -- Dogs and bears, sports and cars, and patriots t-shirts http://www.villagetshirts.com WlND0WS and MAClNT0SH shareware games http://www.gypsyware.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Embedding fonts anomalies
hi Shari, i have not used this feature, but it is really mind opening to see, how developers use font embedding in their apps. Do you have a sample stack that show the approach that you described? Thanks in advance! alejandro Shari-2 wrote: Load several custom fonts. Create a heirarchy of first choice, second choice, etc. If firstChoice is in the fontNames then set the fields to it. Else move to secondChoice, thirdChoice, etc., ending with several fonts that should already be installed on user systems as a last resort. -- View this message in context: http://www.nabble.com/Embedding-fonts-anomalies-tp20448453p20494711.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Embedding fonts anomalies
Am diving into embedding fonts for the first time. I've been reading thru the archives and saw where some folks had troubles with loading custom fonts, where fonts might work on one system but not another, even within the same OS, or produce strange results. So I came up with an idea to ensure that things will work properly regardless of the machine, OS, systemVersion, etc. Is there any reason this wouldn't work? Load several custom fonts. Create a heirarchy of first choice, second choice, etc. If firstChoice is in the fontNames then set the fields to it. Else move to secondChoice, thirdChoice, etc., ending with several fonts that should already be installed on user systems as a last resort. I'd read where folks had trouble with text in fields disappearing and so forth, but if I checked for the font to be in the fontNames first, wouldn't this solve potential problems? The app will end up on thousands of machines of all flavors, so a trouble-free universal solution is necessary. Also, can Rev handle font suitcases as-is? Or do I need to limit specifically to someFont.ttf? Shari -- Dogs and bears, sports and cars, and patriots t-shirts http://www.villagetshirts.com WlND0WS and MAClNT0SH shareware games http://www.gypsyware.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution