Loading fonts?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

peter.s
Posts: 99
Joined: Thu Jul 10, 2008 11:47 am

Post by peter.s » Sat Sep 13, 2008 3:52 am

Judging by the number of Views to this posting, this topic seems to be of moderate interest to Rev Forum visitors. Is it because I am not alone with my inability to manage fonts with Rev? Or is it because I am suffering some odd and obscure font bug? :?

I have tested my stack on another Mac which does not have "the four" fonts installed:

On the test stack without a revfontload script, the desired font was simply substituted by another font from the OS font library.

On the test stack which included the revfontload script, it crashed the application on opening the stack (consistently).

On a PC (as I described in an earlier posting), it would load two of the four fonts - but not crash the app.

I know that different OS platforms manage their fonts differently - but surely they can't be so different that one cannot make a text field and maintain control over how it will look?

How is it done in Rev Media? Or does the Rev Media Player have better control over the fonts then native OS operation?

Any font freaks out there? :)

Peter

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sun Sep 14, 2008 2:46 pm

Hi Peter,

The number of views is a very normal number. I have loaded this thread in my browser 15 or 30 times and if all readers who are interested in this thread do so, there are between 10 and 20 people who read this. While writing this reply, I probably added 4 new hits.

You will have to check what is wrong with those fonts yourself. It is not clear that this is a bug in the revFont external. Try different formats, make sure that there is no other font with an equal font ID number, make sure that the font isn't already loaded etc. If you have a font file that works on all platforms but not in combination with the revFont external, then report it to the quality control centre.

To answer your questions, yes, fonts can be "very different". They can even be so different that I am not sure what you are asking about. If a font doesn't work, it will simply not show up.

Regarding Rev Media, the font external works exactly the same in all version of Revolution, if the external is available in that version. Rev Media Player may have the advantage, however, that it loads the externals by itself.

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

peter.s
Posts: 99
Joined: Thu Jul 10, 2008 11:47 am

Post by peter.s » Mon Sep 15, 2008 4:45 am

Hi Mark,

Thanks for the clarity. Being a novice to this field of work I sometimes find it difficult to determine where a "problem" lies.

I will continue with some more systematic testing and if I find a solution or learn something alarming I will post the results. I am hoping (of course) that the problem will lie with my inexperience, rather than the function of the program.

I am still baffled by the "complexity" of Rev font management though. If Rev Media is being promoted as a presentation tool, then surely it will have a solid font management system - therefore, so would Studio. But as you wrote, maybe the key is in the Rev Media Player?!

Cheers,

Peter

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Mon Sep 15, 2008 9:39 am

maybe the key is in the Rev Media Player?!
I'd say that's too strong a statement already. You just have to make sure that the external loads correctly and that your fonts are compatible. I know that the external works fine most of the time. If it doesn't, it is because of an error in your script or because the fonts are incompatible.

Just another question: did you quit and restart Revolution after removing the relevant fonts from all three system font folders? If you didn't, my script won't even try to load the fonts.

You should add a line in your scripts, which checks whether the font file exists and returns an error if it doesn't.

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

peter.s
Posts: 99
Joined: Thu Jul 10, 2008 11:47 am

Post by peter.s » Tue Sep 23, 2008 9:52 am

I have been chipping away at this font problem for days. Although I have learnt some interesting stuff, I still have not found a solution.

I have re-designed my whole project to incorporate "common" fonts (i.e. Arial!) but I still need to use one character from my "problem font". So my current workaround is to substitute this one character with an image of the "problem font character". I tried this:

set the imagesource of char 1 in fld "Field" to ID#

This seems to work on a simple trial, but I want to substitute, say - "A" with the "image", in several places of the text. I can:

replace "A" with "B" in fld "Field"

But I cannot figure out how to replace "A" while using the imagesource property.

Any suggestions?

Cheers,

Peter

p.s. Thanks Mark for your tips. I looked into this with as much depth as I know how but just found it too unstable for my liking. Sometimes the app would work well and sometimes it would crash on open. I'm sure it is the font in question - one of the other fonts refused to play completely. Very frustrating.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Tue Sep 23, 2008 10:37 am

Hi Peter,

Would it be possible to use a special character for the image, e.g. % or # or perhaps a sequence like $% or &special#? If so, you can use htmlText:

Code: Select all

put the htmlText of fld 1 into myHtml
replace "$special#" with "<img src=" & quote & "1013" & quote & ">" in myHtml
set the htmlText of fld 1 to myHtml
Note: not all special characters and strings can be used for this, because many characters end up as "&uuml;" (ü).

Best regards,

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

peter.s
Posts: 99
Joined: Thu Jul 10, 2008 11:47 am

Post by peter.s » Tue Sep 23, 2008 12:40 pm

That seems to do the trick. Thank you so much Mark!

Now I need to figure out how to apply the TextShift property so I can shove the images into place. It can't bee too hard, I got it working on a simple test the other day.

Finally I feel like I'm making progress :D

Cheers,

Peter

Post Reply