PDA

View Full Version : Native letters



Claus
November 16th, 2014, 13:44
Hi

I think I have see the answer to this question some where in the forum, but I can't find it again. :cry:

I'm adjusting an extension to Danish, but when the skill names written in the Lua file is loaded it don't use the Danish letter.

The tekst in the lua scrip looks like this:

Skills =
{ ["Første hjælpe"] = { Base="INT", Category="Grundf�rdigheter", Grund="INT", Kost="1"},

In the attached picture you can see that the letters "ø" and "æ" looks very odd. It is only for the letters written directly in the lua script. It works fine the xml files due to the iso-8859-1 standard.

What to do I have to do to make lua read Danish letters?

Moon Wizard
November 17th, 2014, 22:26
FG uses a single byte string representation to translate text from Lua and database values into visible data on the screen. The font files (FGF) are a collection of 256 bitmaps rendered for each character in a single byte representation of that font. Depending on which font was used to render the FGF files, there can be differences in the actual glyphs/bitmaps displayed for those characters.

A couple thoughts:
* It could be the font missing certain glyphs for those characters. (i.e. not a true/full ISO-8859-1 output)
* It could be that the characters are being translated incorrectly somewhere along the way (Lua, FG API, ...)

I'm able to type those characters directly into 3.5E and 5E rulesets in the Skills sections, and see them correctly. So, I'm assuming it's a different ruleset with old font files.

Which ruleset are you modifying?

Regards,
JPG

Claus
November 19th, 2014, 20:35
Hi moon Wizard

It's the BRP ruleset, that I'm modifying.


A couple thoughts:
* It could be the font missing certain glyphs for those characters. (i.e. not a true/full ISO-8859-1 output)
* It could be that the characters are being translated incorrectly somewhere along the way (Lua, FG API, ...)

I think it's a problem between Lua and FG api. When I write one of the characters in a string field in FG, it is shown correct.

Moon Wizard
November 20th, 2014, 22:59
It has something to do with the existing encoding of the brpscript.lua file that you are modifying. Make sure that you set the encoding on the file you are creating that contains that string to ISO-8859-1.

I verified the existing issue by:
* Opening brpscript.lua file.
* Pasting in new skill line just below "First Aid" skill line.
* Saving file
* Open new campaign and create new character.

To fix,
* I opened the brpscript.lua file.
* Used my text editor (Notepad++) to specifically set the encoding to ISO-8859-1
* Noted that the previously pasted text was now mangled (exactly like messed up display before)
* Replaced the skill with the same text re-pasted from the forum.
* Saved file
* Opened character and found correct skill display.

Cheers,
JPG

Claus
November 23rd, 2014, 13:00
Thanks Moon, but how and where in the brpscript.lua file did you set the encoding?

damned
November 23rd, 2014, 22:13
Claus for XML its usually the first line in these files:
<?xml version="1.0" encoding="iso-8859-1"?>
Im not sure how you do it in LUA...

Claus
November 24th, 2014, 22:41
Ok - thanks :)

Trenloe
November 24th, 2014, 22:44
Thanks Moon, but how and where in the brpscript.lua file did you set the encoding?
If you're using Notepad++, open the LUA file and select Encoding -> Character Sets -> Western European -> ISO 8859-1

damned
November 24th, 2014, 23:45
+Trenloe - I did see that in searching... so for the LUA you just need to save the file with the correct encoding?
You dont actually add any character sets / encoding tags / instructions.

Claus
November 25th, 2014, 21:27
Hi Trenloe

That worked! Thanks! :)

Kilitar
November 29th, 2014, 02:30
I have similar troubles - with some Czech letters - ě š č ř ž ý á í etc.. they are corrupted/broken.
We are using standard english version (not translated XML/LUA) of FG, but we are trying to roleplaying in our own native language.
And we cannot use those letters neither in chat window, neither to create own libraries/adventures/items/NPCs

Moon Wizard
November 30th, 2014, 00:30
Some of the letters will work, but others will not. The fonts for most FG rulesets were built from the ISO-8859-1 encoding scheme.
https://en.wikipedia.org/wiki/ISO/IEC_8859-1
According to the Wikipedia page, there are a number of Czech characters that are not supported by this ISO standard.

FG currently only supports single-byte strings (not Unicode). We are not currently set up to support full internationalization of FG.

You could try writing an extension which replaces the fonts in the ruleset with fonts built using a different encoding, but not sure if the key codes received by FG from OS will match up. Someone would have to build extension and font, and test on a native OS system to be sure.

Regards,
JPG