txt2dat for unicode


txt2dat for unicode
#1
Is there a tool like txt2dat but allows unicode characters?
Reply
RE: txt2dat for unicode
#2
(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
After that... need to shrink to get superscript, but that's another story Wink
Reply
RE: txt2dat for unicode
#3
(2020-05-08, 9:56)Philippe Hurbain Wrote: 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
After that... need to shrink to get superscript, but that's another story Wink

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.
Reply
RE: txt2dat for unicode
#4
(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
Reply
RE: txt2dat for unicode
#5
(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.

my 2cts

There's no ascii code. It's U-201C
Reply
RE: txt2dat for unicode
#6
(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.
Reply
RE: txt2dat for unicode
#7
(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.
Reply
RE: txt2dat for unicode
#8
(2020-05-09, 23:36)Roland Melkert Wrote: 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.

Oh. Ok. Cool. Thanks ?
Reply
RE: txt2dat for unicode
#9
(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.
Reply
RE: txt2dat for unicode
#10
(2020-05-09, 23:12)Orion Pobursky Wrote: There's no ascii code. It's U-201C
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:
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

.png   Capture.PNG (Size: 29.21 KB / Downloads: 33)
Gives this
   
Reply
RE: txt2dat for unicode
#11
(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:
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

Gives this
Thanks for spelling it out for my dense brain. I thought I knew this stuff but I guess the answer to that is no.
Reply
RE: txt2dat for unicode
#12
(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.


.png   6022692e_three1.png (Size: 17.16 KB / Downloads: 30)

And it worked. Thanks again.
Reply
RE: txt2dat for unicode
#13
(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:
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

Gives this

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.
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 6 Guest(s)