OESF Portables Forum

General Forums => General Discussion => Topic started by: w14 on August 08, 2004, 06:23:24 pm

Title: Font frustration
Post by: w14 on August 08, 2004, 06:23:24 pm
Often when I am browsing with Opera, text does not render correctly. For example, a "-" will render as a square, I assume because the fonts included with the Z are reduced character sets.

I see the same results when I convert certain webpages to .pdb files for displaying on Opie Reader.

Does anyone have any recommendations for how best to encode html pages using JPluckX for use on the Z? TimW, are you there?

Thanks,

Mike.
Title: Font frustration
Post by: Stubear on August 08, 2004, 08:07:19 pm
Under configuration check "remap" - this will turn long - into -- and funny " into real "

The other option is to change the codeset to windows 1252 or 1250 - this seems to work for most pages.

It's a font problem more than a opie-reader problem, I installed arial unicode and most of the problems went away, but the arial font is too big.

Stu
Title: Font frustration
Post by: TimW on August 09, 2004, 04:31:05 am
Quote
windows 1252 or 1250

Actually, "Palm" encoding is slightly better 8^) (on opie-reader's Locale tab in the settings dialog). This is a minor modification of the windows encoding which is different in about 4-5 characters but it does match the original Palm font encoding exactly.
Title: Font frustration
Post by: w14 on August 09, 2004, 07:43:51 am
Thanks!

I had remap checked and it didn't seem to change anything on its own. Changing the encoding as you both described did the trick. If only Opera was so easy ...

Cheers,

Mike.
Title: Font frustration
Post by: vinc17 on August 09, 2004, 08:26:24 am
I have a similar problem on my SL-C860: the --- (mdash) is not shown. This is not an encoding problem (the HTML source code contains the corresponding numeric entity).

Where can I find "remap"?
Title: Font frustration
Post by: w14 on August 09, 2004, 09:06:04 am
Quote
Where can I find "remap"?

file menu/settings/configuration/layout tab

Mike.
Title: Font frustration
Post by: TimW on August 09, 2004, 09:20:33 am
Almost forgot. If you are using Mobipocket files (eg the Baen free library .prc files) then you will probably also need to select Repalm on the Layout tab of the Settings/Configuration dialog. This is because Mobipocket format uses html style entities but uses them for palm encoding rather than unicode.
Title: Font frustration
Post by: ShiroiKuma on August 09, 2004, 09:56:11 am
Quote
It's a font problem more than a opie-reader problem, I installed arial unicode and most of the problems went away, but the arial font is too big.

Stubear, how did you install ArialUnicode on the Zaurus? It's a truetype font? How do you do this?

Later.
Title: Font frustration
Post by: Stubear on August 09, 2004, 07:22:50 pm
Downloaded makeqpf from  ftp://zaurus.ionkov.net/pub/makeqpf (http://ftp://zaurus.ionkov.net/pub/makeqpf)

and then did

Code: [Select]
makeqpf -display Transformed:Rot270 -A
More info here  (http://docs.zaurus.com/index.php?id=ttf_conversion)

Stu
Title: Font frustration
Post by: ShiroiKuma on August 10, 2004, 04:00:16 am
Right, I've read the page. I'd like to ask: I don't have a linux desktop PC, so can I somehow run this command on the Zaurus? It's not a shell script as I see.

So can I do the conversion on the Zaurus?

Later.
Title: Font frustration
Post by: TimW on August 10, 2004, 04:24:34 am
I think there is a Zaurus version at http://moria.ionkov.net/zaurus/makeqpf/ (http://moria.ionkov.net/zaurus/makeqpf/)

Get makeqpf-arm.zip  (I think)
Title: Font frustration
Post by: ShiroiKuma on August 10, 2004, 05:30:06 am
Thanks. I've downloaded the arm version, but would ask for a more explicit help also.

I've put the arialun.ttf and the makeqpf-arm in a temp directord on a cf card. Then tried running the makeqpf command as above, however I got a bunch of lines saying "Already a ROM font"...

I'm not sure whether I should edit the fontdir file as per the above page before the font conversion is done? Should I?

Should I explicitly put in all the lines for all the arialuni.ttf font sizes? If I want bold and italics, should I also put in lines for that? Does the font have to be copied to the fonts directory for this? Or should I edit the fontdir and put in the whole path to the CF location?

Thanks for help.
Title: Font frustration
Post by: TimW on August 10, 2004, 06:14:59 am
I did this once a long time ago but IIRC you need to put the ttf files in /opt/Qtopia/lib/fonts (same directory as fontdir), edit fontdir as per the instructions on the referenced page and then run "makeqpf -A" (without the quotes).

The bunch of lines about Already a ROM font are a good sign. This just means that you already have some qpf files installed. But it won't convert the ttf unless the ttf is in the right place and the changes are made to fontdir.

The only other gotcha is that makeqpf tries to take over the frame buffer but a restart of qtopia is all that is needed. I have a SL5000 with less memory and I found it was better if I quit Qtopia altogether and then did a soft reset but you will probably have enough memory not to do that (providing you can find the restart qtopia button after makeqpf has run).
Title: Font frustration
Post by: ShiroiKuma on August 10, 2004, 08:19:09 am
Hi:

I think I need some more help here.

I copied the arialuni.ttf to the /opt/Qtopia/lib/fonts directory.

edited fontdir, I added the following lines:

Code: [Select]
ArialUnicode arialuni.ttf TTF n 50 80 u
ArialUnicode arialuni.ttf TTF n 50 100 u
ArialUnicode arialuni.ttf TTF n 50 120 u
ArialUnicode arialuni.ttf TTF n 50 140 u
ArialUnicode arialuni.ttf TTF n 50 160 u
ArialUnicode arialuni.ttf TTF n 50 180 u
ArialUnicode arialuni.ttf TTF n 50 200 u
ArialUnicode arialuni.ttf TTF n 50 240 u
ArialUnicode arialuni.ttf TTF n 50 360 u
ArialUnicode arialuni.ttf TTF n 50 480 u
ArialUnicode arialuni.ttf TTF n 50 720 u
ArialUnicode arialuni.ttf TTF y 50 80 u
ArialUnicode arialuni.ttf TTF y 50 100 u
ArialUnicode arialuni.ttf TTF y 50 120 u
ArialUnicode arialuni.ttf TTF y 50 140 u
ArialUnicode arialuni.ttf TTF y 50 160 u
ArialUnicode arialuni.ttf TTF y 50 180 u
ArialUnicode arialuni.ttf TTF y 50 200 u
ArialUnicode arialuni.ttf TTF y 50 240 u
ArialUnicode arialuni.ttf TTF y 50 360 u
ArialUnicode arialuni.ttf TTF y 50 480 u
ArialUnicode arialuni.ttf TTF y 50 720 u
ArialUnicode arialuni.ttf TTF n 75 80 u
ArialUnicode arialuni.ttf TTF n 75 100 u
ArialUnicode arialuni.ttf TTF n 75 120 u
ArialUnicode arialuni.ttf TTF n 75 140 u
ArialUnicode arialuni.ttf TTF n 75 160 u
ArialUnicode arialuni.ttf TTF n 75 180 u
ArialUnicode arialuni.ttf TTF n 75 200 u
ArialUnicode arialuni.ttf TTF n 75 240 u
ArialUnicode arialuni.ttf TTF n 75 360 u
ArialUnicode arialuni.ttf TTF n 75 480 u
ArialUnicode arialuni.ttf TTF n 75 720 u
ArialUnicode arialuni.ttf TTF y 75 80 u
ArialUnicode arialuni.ttf TTF y 75 100 u
ArialUnicode arialuni.ttf TTF y 75 120 u
ArialUnicode arialuni.ttf TTF y 75 140 u
ArialUnicode arialuni.ttf TTF y 75 160 u
ArialUnicode arialuni.ttf TTF y 75 180 u
ArialUnicode arialuni.ttf TTF y 75 200 u
ArialUnicode arialuni.ttf TTF y 75 240 u
ArialUnicode arialuni.ttf TTF y 75 360 u
ArialUnicode arialuni.ttf TTF y 75 480 u
ArialUnicode arialuni.ttf TTF y 75 720 u

Then ran
Code: [Select]
makeqpf -display Transformed:Rot270 -A
But then I get the following output on the screen:
Code: [Select]
QServerSocket: failed to bind or listen to the socket
and a bunch of
Code: [Select]
Already a ROM fontlines.

However no qpf fonts are output as the result.

Where am I going wrong?

Later.
Title: Font frustration
Post by: TimW on August 10, 2004, 09:27:47 am
From the Trolltech pages referenced in the original how-to:

Quote
When Qt/Embedded applications run, they look for a file called $QTDIR/etc/fonts/fontdir or /usr/local/qt-embedded/etc/fonts/fontdir. This file defines the fonts available to the application. It has the following format:


name file renderer italic weight size flags
where:


name  Helvetica, Times, etc. 
file  helvR0810.bdf, verdana.ttf, etc. 
renderer  BDF or TTF 
italic  y or n 
weight  50 is Normal, 75 is Bold, etc. 
size  0 for scalable or 10 times pointsize (eg. 120 for 12pt) 
flags  Flag characters:
s = smooth (anti-aliased)
u = unicode range when saving (default is Latin 1)
a = ascii range when saving (default is Latin 1)

Not easy to understand - especially as there is no example.

What it means is you only need four entries for each font (one each for normal, italic, bold and bold-italic)

ArialUnicode arial.ttf TTF n 50 0 su 80,100,120,140,160,180,200,240,360,480,720
ArialUnicode ariali.ttf TTF y 50 0 su 80,100,120,140,160,180,200,240,360,480,720
ArialUnicode arialbd.ttf TTF n 75 0 su 80,100,120,140,160,180,200,240,360,480,720
ArialUnicode arialbi.ttf TTF y 75 0 su 80,100,120,140,160,180,200,240,360,480,720

respectively (use the actual names of the font files on your system - I've used the names as they are on my windows machine). The extra "s" just before the u generates anti-aliased fonts - like smoothtimes - just leave it off if you don't like anti-aliasing. Also, I don't think you really want all those sizes as they get quite big - especially the larger fonts. OTOH, you know better than I do how much space you have spare.

Also, I don't think you need the -display Transformed:Rot270 if you run it on the Zaurus as it can automatically tell that the display is rotated. But remember - this is all from memory of something I did a long while back.

I don't think either of the messages you got are a cause for concern - the Zaurus makeqpf is built with some compromises which means it doesn't play nice...but it does work.
Title: Font frustration
Post by: ShiroiKuma on August 10, 2004, 10:35:04 am
Quote
What it means is you only need four entries for each font (one each for normal, italic, bold and bold-italic)

ArialUnicode arial.ttf TTF n 50 0 su 80,100,120,140,160,180,200,240,360,480,720
ArialUnicode ariali.ttf TTF y 50 0 su 80,100,120,140,160,180,200,240,360,480,720
ArialUnicode arialbd.ttf TTF n 75 0 su 80,100,120,140,160,180,200,240,360,480,720
ArialUnicode arialbi.ttf TTF y 75 0 su 80,100,120,140,160,180,200,240,360,480,720
OK, changed the fontdir entries referring to the ArialUnicode font to this, however the result was the same. Same messages, no fonts produced.

Then I tried changing the TTF in the above lines to FT, since I noticed that all the refences to .ttf fonts in the original fontdir have the FT argument not TTF. Does this maybe stand for FreeType?

Anyhow, now ran the makeqpf -A again and now it's displayed the "QServerSocket..." text for a long time, i.e. no "Already a ROM font" message now for a long time, so either it's working, or it got stuck.

Let's see, it's been going on for 10 minutes now. Could it be taking this long?
Title: Font frustration
Post by: ShiroiKuma on August 10, 2004, 10:37:34 am
Oh, and now I did run out of memory...  

So how do I quit Qtopia alltogether, to just run it from the console, to free up memory?

I already uninstalled all the applications, except the console, to free up memory.
Title: Font frustration
Post by: TimW on August 10, 2004, 10:56:02 am
The FT instead of TTF sounds familiar - sorry that I forgot that but I don't even have my Zaurus on me to check my fontdir.

It sounds like its working but you should probably get rid of the bigger sizes in the list.

I have an application on my settings tab whose icon (IIRC) is a big red stop button. If you open that up - or install it first, and then open it up if you don't have it - that enables you to Reboot, Restart Qtopia or to Leave Qtopia. If you leave Qtopia you drop down to a simple console where you can enter the command as before. Unfortunately it was pre-installed in my ROM so I don't know what it is called.

Failing that, if you press (IIRC) / during the countdown after a soft reset you can choose whether to start qtopia or use a console (plus some other options I don't remember).

Typing reboot at the prompt is effectively a soft reset so may be the easiest way of getting back to Qtopia after you have finished.

I managed to do this on an SL5000D so it should be possible but I didn't do any fonts bigger than 24pts.
Title: Font frustration
Post by: ShiroiKuma on August 10, 2004, 11:05:26 am
OK, I'll remove the large sizes first, to see if it goes through.

Quote
Failing that, if you press (IIRC) / during the countdown after a soft reset you can choose whether to start qtopia or use a console (plus some other

But what is IIRC?
Title: Font frustration
Post by: TimW on August 10, 2004, 11:10:18 am
IIRC = If I Recall Correctly

It just means I'm working from memory. That means I think the key you have to push is the "/" key - some ROMs tell you which key it is. Failing that try the space key.

Anyway, the app is listed as Shutdown and is on the Settings tab if that helps.
Title: Font frustration
Post by: yzord on August 10, 2004, 11:12:51 am
Quote
I have an application on my settings tab whose icon (IIRC) is a big red stop button. If you open that up - or install it first, and then open it up if you don't have it - that enables you to Reboot, Restart Qtopia or to Leave Qtopia. If you leave Qtopia you drop down to a simple console where you can enter the command as before. Unfortunately it was pre-installed in my ROM so I don't know what it is called.
Hey Tim!

BTW, the red stop icon is just the gui for the "shutdown" command. Unfortunately, the gui is more flexible than the console "shutdown" command (weird). Just add a desktop file pointing to the shutdown executable in your apps directory of choice.

Yz
Title: Font frustration
Post by: ShiroiKuma on August 10, 2004, 11:28:50 am
I see,  

Well, I edited the fontdir file just leaving this line refering to ArialUnicode:
Code: [Select]
ArialUnicode arialuni.ttf TTF n 50 0 su 80It didn't run out of memory, but: it gave me the QServerSocket... text first, then ran for about ten minutes with no output, presumably working on the font.

But then a bunch of
Code: [Select]
QFile::writeBlock: File not open lines apeared, like tens of them... and then it finished. So no font output.

What's the problem with this?
Title: Font frustration
Post by: TimW on August 10, 2004, 11:32:23 am
Hi Yzord - thanks for assisting my failing memory 8^).

Quote
[CODE]QFile::writeBlock: File not open

Have you run out of "disk" space? Do a "df" at the console and it will tell you how much room you have left. Compare that to the sizes of the other qpf files to see if there is room.
Title: Font frustration
Post by: ShiroiKuma on August 10, 2004, 11:40:48 am
There's 46 megs available in flash memory, so that shouldn't be a problem, no?
Title: Font frustration
Post by: TimW on August 10, 2004, 11:46:34 am
Quote
There's 46 megs available in flash memory, so that shouldn't be a problem, no?
True - providing that is where the files are going. I don't usually have a typical configuration on my machine so I am a bit vague about this but it is possible that the /opt/Qtopia/lib/fonts directory is non-writable, though I doubt it.

It may also be a permissions problem. If you aren't running makeqpf as root then you may not have write permission. If you do "whoami" in the console and it doesn't say "root" then do "su" (stands for set user and defaults to root) and then run makeqpf.
Title: Font frustration
Post by: ShiroiKuma on August 10, 2004, 11:59:55 am
This is probably the problem, because I tried su'ing, but when I try to run makeqpf as su, it tells me that:
Code: [Select]
Qt/Embedded data directory is not owned by user 0so I ran it not from # but as regular user from $, but obviously then the fonts directory is not writeable.

So how can I own the directory as su? Or whatever do I need to do?
Title: Font frustration
Post by: ShiroiKuma on August 10, 2004, 01:39:34 pm
OK, tried, tried, and tried and I think I figured it out. So for future reference, this is what I had to do:
Code: [Select]
$
cd /tmp
mv qtembedded-zaurus qtembedded-zaurus.bak
cp qtembedded-zaurus.bak/QtEmbedded-0.spec .
su
#
cp -r qtembedded-root qtembedded-zaurus
mv QtEmbedded-0.spec qtembedded-zaurus/
After this I was able to generate the fonts using the above procedure.

The only glitch seems to be is at the end I get a couple of lines of
something like: Error can't grab bitmap -1

It scrolls by too fast...

The fonts render though, so maybe it's not fatal.

Thanks for the help, guys.

The only unresolved thing is terminating Qtopia on the 760 which I ask about here (https://www.oesf.org/forums/index.php?showtopic=3242&hl=). Anyone know?
Title: Font frustration
Post by: TimW on August 11, 2004, 02:57:37 am
Congratulations 8^). That became a bit of a marathon in the end. When I did my font generation I was using an old ROM (it wasn't old at the time) where everything ran as root so I didn't get the permissionms problem.

The link to the other discussion goes to the small ad at the top of the page with no other content for me but I think I did see the discussion earlier where you said something like you didn't get the countdown during the shutdown. That is normal, you should get the countdown during start-up. If you don't get it, then it is probably only the message which has been removed rather than the whole start-up being changed. It may be worth pressing the "/" key a few times during start-up to see if it works. Note that this is during the part of the boot where the device is wholly in console mode. Once you get any graphical stuff (apart from the original boot picture) you know you've missed it.

Unfortunately I don't have a C-type Zaurus to try it out for you.
Title: Font frustration
Post by: ShiroiKuma on August 11, 2004, 05:53:02 am
Sorry, that's my mistake, fixed the link in the above post now.

However, during boot there is no countdown now, so it must've been removed.

First there is the "Wait a minute" screen, during which I hit / alot. After a while there appears a black console line at the bottom of the screen, where what you press on the keyboard actually displays thus /// etc. If you hit enter, the line clears, but no menu pops up, nothing.

After a while more, the graphical zaurus logo pops up etc.

So it doesn't work like this... Any other ideas?
Title: Font frustration
Post by: TimW on August 11, 2004, 06:22:08 am
I've added my latest idea to the thread you linked to - hope it works for you 8^)