Graphics question: Font geometries

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
WWWWolf
Posts: 53
Joined: Thu May 14, 2020 1:34 pm

Graphics question: Font geometries

Post by WWWWolf »

Good news. Finnish U7BG translation is going well. Today, I wrote a script to dump my text from the database and recompile the usecode. And lo and behold, the first scene works fine. I'm almost done translating all conversations in Trinsic.

Anyway, a small problem: I modified the letters a,o,A,O to ä,ö,Ä,Ö in Personal Paint for Amiga (I don't happen to have any other good paletted pixel art programs around =), cropped in GIMP, and... then what?

Now, a small problem: ExultStudio-exported graphics have following sort of image geometries:

capA.png PNG 13x14 1x11-12-3 DirectClass 942

...and my own pictures have this geometry:

capAE.png PNG 13x14 13x14+0+0 PseudoClass 256c 958

My transparency doesn't work at all, but I suppose that can be handled by converting the picture to DirectClass (24-bit RGB). But what's really weirding me up is the weird geometry spec, 1x11-12-3. As the letters appear in game now, they are in completely wrong position.

Does anyone know how to fix this weird geometry problem in Linux?
- Weyfour WWWWolf, a lupine technomancer from the cold north
[a.k.a.: Hoki-Aamrel the Cherry-Red Dragon -==(UDIC)==- ]
WWWWolf
Posts: 53
Joined: Thu May 14, 2020 1:34 pm

Re: Graphics question: Font geometries

Post by WWWWolf »

Actually, I just tried converting paletted files to RGB and surprise surprise, the new letters are still black rectangles. =/

So now I have two problems: How do I *really* get the things stay transparent, and how do I *really* get the thing offsetted in the right place?

Wishing TrueType Was Invented,
- Weyfour WWWWolf, a lupine technomancer from the cold north
[a.k.a.: Hoki-Aamrel the Cherry-Red Dragon -==(UDIC)==- ]
WWWWolf
Posts: 53
Joined: Thu May 14, 2020 1:34 pm

Re: Graphics question: Font geometries

Post by WWWWolf »

OK, found out that Yes, Alpha Channels Actually Do Work.

But I have slight problems with the *weird* offset things. Basically, if I open up Studio, open up fonts.vga, pick a letter from the yellow font, then export it to .png and open the .png in GIMP, I get a layer that's been moved a bit to side. Which GIMP can't save, because the layer has an offset. Um, a file that can be opened but not saved because the format doesn't support what... it... has. A little bit of a chicken and egg problem...

ImageMagick seems to call this the "page" geometry, but refuses to create a file with negative offsets.

Okay, can anyone tell me what to hex-edit in my .png files? =)
- Weyfour WWWWolf, a lupine technomancer from the cold north
[a.k.a.: Hoki-Aamrel the Cherry-Red Dragon -==(UDIC)==- ]
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: Graphics question: Font geometries

Post by marzo »

and open the .png in GIMP, I get a layer that's been moved a bit to side. Which GIMP can't save,
Hmm. At least with the version I am using of GIMP (2.2.11 -- but IIRC, it was the same from 2.2.6 onwards), it says that it can't save but offers the option of saving anyway -- 'ignore' -- and it works.

From what you said, what you have been calling 'geometry' is what Exult Studio calls 'origin', but multiplied by -1. Try double-clicking the character in fonts.vga and setting origin. For example,

Code: Select all

capA.png PNG 13x14 1x11-12-3 DirectClass 942
the -12 and -3 are very likely the numbers of interest; in ES, set 'origin' to 12 and 3, apply and save the file.
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
WWWWolf
Posts: 53
Joined: Thu May 14, 2020 1:34 pm

Re: Graphics question: Font geometries

Post by WWWWolf »

Ohhhkayyyy... Weirdly enough, it doesn't appear to save an oFFs chunk to the PNG file no matter if I tell it to, so I guess the offset is needed.

But thank you - the origin thingy seems to work just fine. The ES user interface isn't the best possible; I had no idea it applies to each frame individually. But now that it was set, whee, it works just fine. And here I was already cursing the mysteries of RMagic and all... =)

http://www.iki.fi/wwwwolf/games/ultima/ ... rstrun.jpg
- Weyfour WWWWolf, a lupine technomancer from the cold north
[a.k.a.: Hoki-Aamrel the Cherry-Red Dragon -==(UDIC)==- ]
WWWWolf
Posts: 53
Joined: Thu May 14, 2020 1:34 pm

Re: Graphics question: Font geometries

Post by WWWWolf »

Egh. It really shows it's past three in the morning. What I meant was, GIMP saves the pic but it doesn't work for me, no matter if I check the layer offset option in GIMP's PNG save options.
- Weyfour WWWWolf, a lupine technomancer from the cold north
[a.k.a.: Hoki-Aamrel the Cherry-Red Dragon -==(UDIC)==- ]
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Graphics question: Font geometries

Post by drcode »

Maybe ES has a bug getting the offset when it reads the PNG file back in. I seem to recall this happening before. In any case, your font looks great.
Locked