Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (3) </ 1 [2] 3 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: customizing murgaLua, env variable: LUA_INIT< Next Oldest | Next Newest >
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: April 25 2008,13:06 QUOTE

Found a very odd thing while running some tests. I'll need to ask JohnMurga if he knows anything about it...

I tried this script to see what fonts are available:
Code Sample
numfonts=Fl:set_fonts()
for i=0,numfonts do
print(Fl:get_font_name(i)) end

Every font that had been set in LUA_INIT printed what appears to be garbage.
After fooling around a little more I found that using the command Fl:get_font_name(0) in LUA_INIT would cause FL_HELVETICA to print the appropriate name of the font I had set.

However, if I moved that command from LUA_INIT to the script, it didn't work anymore.

So apparently, in order for scripts to retrieve the appropriate font name, you must retrieve in within LUA_INIT, after the font has been set:
Code Sample
Fl:set_font(4,"terminus")
Fl:set_font(0,"smooth")
for i=0,15 do Fl:get_font_name(i) end

I did it for all 16 fonts in one go just so I don't have to bother with it again in the future.

A couple more notes:
Regardless of the above issue, murgaLua 0.6.8 now handles X font names much better than it did before. In the fonts-system demo in the murgaLua demos package the X font names would be rather messy (-*-fixed-medium-r-normal--*, for example). Now it simply uses the name "fixed".  If you attempt to use "-*-terminus-*" now, instead of just "terminus", the result can be a bit unpredictable.

Also, murgaLua *tries* to apply bold/italic using the same custom font, apparently, but if you don't have bold/normal versions of that font installed you also get unpredictible results.  It seems that FLTK just picks something that it thinks resembles what you want.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
roberts Offline





Group: Members
Posts: 4983
Joined: Oct. 2003
Posted: May 05 2008,03:43 QUOTE

Still have not been able to set font system wide for murgaLua scripts.
mikshaw, can you give an example to use, say, 7x14 ?
Back to top
Profile PM WEB 
roberts Offline





Group: Members
Posts: 4983
Joined: Oct. 2003
Posted: May 05 2008,03:45 QUOTE

When I use the dynamic build of murgaLua, I don't seem to have "plastic" scheme?
Back to top
Profile PM WEB 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: May 05 2008,11:53 QUOTE

According to the fonts.dir file (misc), 7x14 is -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso10646-1

Fl:set_font(0,"-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso10646-1")
Fl:set_font(1,"-misc-fixed-bold-r-normal--14-130-75-75-c-70-iso10646-1")

Keep in mind that the font will not scale if you specify an exact font rather than a font face, Fl:set_font(0,"fixed") for example.

I have no idea about the scheme...haven't used the dynamic build.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
roberts Offline





Group: Members
Posts: 4983
Joined: Oct. 2003
Posted: May 05 2008,14:59 QUOTE

Thanks. Yes, it does work in 4.x. I should have tried that first. I was trying dsl v5.x with dynamic murgaLua. Still having issues there.
Back to top
Profile PM WEB 
11 replies since April 08 2008,17:08 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (3) </ 1 [2] 3 >/
reply to topic new topic new poll
Quick Reply: customizing murgaLua

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code