txt2dat for unicode - Printable Version +- LDraw.org Discussion Forums (https://forums.ldraw.org) +-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html) +--- Forum: Parts Author Tools (https://forums.ldraw.org/forum-24.html) +--- Thread: txt2dat for unicode (/thread-24022.html) |
txt2dat for unicode - Orion Pobursky - 2020-05-07 Is there a tool like txt2dat but allows unicode characters? RE: txt2dat for unicode - Philippe Hurbain - 2020-05-08 (2020-05-07, 23:39)Orion Pobursky Wrote: Is there a tool like txt2dat but allows unicode characters?None I know of... I use the character code I want to add with -a option: eg. to get the ® Code: txt2dat -s "LEGO" -a 174 -s " House" -o house.dat -l -p 50 -h 80 -c 15 -b 0 Arial.ttf RE: txt2dat for unicode - Travis Cobbs - 2020-05-09 (2020-05-08, 9:56)Philippe Hurbain Wrote: None I know of... I use the character code I want to add with -a option: Note that in theory you can get a lot of characters generated this way by changing your Windows Code Page. I don't know off-hand how to do that, or if simply setting an environment variable can localize it to the command window where you're running txt2dat. Side note: txt2dat appears to be gone from the internet. RE: txt2dat for unicode - Roland Melkert - 2020-05-09 (2020-05-09, 3:36)Travis Cobbs Wrote: Note that in theory you can get a lot of characters generated this way by changing your Windows Code Page. I don't know off-hand how to do that, or if simply setting an environment variable can localize it to the command window where you're running txt2dat. You could use a font editor to get the needed characters in the 65-90 range in a modified custom font file. my 2cts RE: txt2dat for unicode - Orion Pobursky - 2020-05-09 (2020-05-09, 22:16)Roland Melkert Wrote: You could use a font editor to get the needed characters in the 65-90 range in a modified custom font file. There's no ascii code. It's U-201C RE: txt2dat for unicode - Roland Melkert - 2020-05-09 (2020-05-09, 23:12)Orion Pobursky Wrote: There's no ascii code. It's U-201C Font files have a character table, so with an editor (maybe fontforge ?) you can move whatever is at U-201C to e.g. 65. Then use the modified (saved as) font file with txt2dat to let it render 'A' which is actually the U-201C character. RE: txt2dat for unicode - Roland Melkert - 2020-05-09 (2020-05-09, 23:16)Roland Melkert Wrote: maybe fontforge ? It's very easy in font forge: https://fontforge.org/en-US/ Just copy the glyph at 0x201c and paste it in an ascii character slot (e.g. the normal " one) so non unicode programs can use it anyway. RE: txt2dat for unicode - Orion Pobursky - 2020-05-09 (2020-05-09, 23:36)Roland Melkert Wrote: It's very easy in font forge: Oh. Ok. Cool. Thanks ? RE: txt2dat for unicode - Travis Cobbs - 2020-05-10 (2020-05-09, 23:12)Orion Pobursky Wrote: There's no ascii code. It's U-201C That's character 147 in the default Windows code page in America (CP 1252, Windows Latin 1): https://en.wikipedia.org/wiki/Windows-1252 So, -a 147 should produce that character without requiring any font editing. RE: txt2dat for unicode - Philippe Hurbain - 2020-05-10 (2020-05-09, 23:12)Orion Pobursky Wrote: There's no ascii code. It's U-201CNote that I didn't talk of ASCII code... I explore the character table of the font I want to use till I find the glyph I need, and add the (decimal) code to txt2dat command line: Code: txt2dat -a 7682 -a 65210 -a 946 -a 1488 -a 9567 -o characters.dat -l -p 50 -h 120 -c 15 -b 0 Arial.ttf Capture.PNG (Size: 29.21 KB / Downloads: 33) Gives this RE: txt2dat for unicode - Orion Pobursky - 2020-05-10 (2020-05-10, 7:11)Philippe Hurbain Wrote: Note that I didn't talk of ASCII code... I explore the character table of the font I want to use till I find the glyph I need, and add the (decimal) code to txt2dat command line:Thanks for spelling it out for my dense brain. I thought I knew this stuff but I guess the answer to that is no. RE: txt2dat for unicode - Orion Pobursky - 2020-05-10 (2020-05-10, 17:36)Orion Pobursky Wrote: Thanks for spelling it out for my dense brain. I thought I knew this stuff but I guess the answer to that is no. 6022692e_three1.png (Size: 17.16 KB / Downloads: 30) And it worked. Thanks again. RE: txt2dat for unicode - Travis Cobbs - 2020-05-10 (2020-05-10, 7:11)Philippe Hurbain Wrote: Note that I didn't talk of ASCII code... I explore the character table of the font I want to use till I find the glyph I need, and add the (decimal) code to txt2dat command line: That means that my suggestion wouldn't have worked, since -a is clearly not using the code page. It also means that somebody could write a Unicode-aware app that produces txt2dat command lines using -a, since the value after the -a appears to just be the Unicode value converted from hexadecimal to decimal. |