Jump to content


Photo

How to open and edit the .dat file safely and successfully ? (Purposes: Font editing)

.dat files ..dat editing .dat editor

11 replies to this topic

#1 Petike the Taffer

Petike the Taffer

    Member

  • Member
  • PipPip
  • 322 posts

Posted 02 February 2018 - 03:37 AM

Hello all.

 

One perpetual snag I keep hitting in my efforts to add or improve letters in existing fonts, for the purposes of translation, is the difficulty of accessing the .dat file that is apparently crucial for making the minor changes to the fonts stick, and allow these fonts to work properly with the added new letters.

 

Any advice on how to solve this issue, whether via external software or other solutions ?

 

I'm on Windows 7 32-bit, if that's in any way relevant to what I should get or how I should resolve this issue.

 

Thank you all for any advice.

 

 



#2 freyk

freyk

    Advanced Member

  • Member
  • PipPipPip
  • 637 posts

Posted 02 February 2018 - 10:59 AM

Which dat-file?

Have you tried to change the filename extension from .dat to .zip?

 

@forumadmin

topic move to techsupport or art.


Edited by freyk, 02 February 2018 - 11:00 AM.


#3 Petike the Taffer

Petike the Taffer

    Member

  • Member
  • PipPip
  • 322 posts

Posted 02 February 2018 - 01:04 PM

Which dat-file?

Have you tried to change the filename extension from .dat to .zip?

 

@forumadmin

topic move to techsupport or art.

 

I think this should be moved to Art Assets. It's part of an i18n effort for one language. The fonts need adding to and editing for that particular language.



#4 stumpy

stumpy

    Advanced Member

  • Member
  • PipPipPip
  • 1775 posts

Posted 02 February 2018 - 04:10 PM

usually to edit fonts you get the original true type font, use a free font editor that can load and save true type fonts, edit the font the way you want, then use the software, it used to be linked in the wiki. to change the modified true type font into the <filename>.dat and <filename>.dds files.


  • Petike the Taffer likes this

#5 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37188 posts

Posted 02 February 2018 - 04:16 PM

Any changes to the fonts will need to preserve the work I did updating the menu fonts for 2.06.

 

post-9-0-72960700-1507939769.jpg

 

 

post-9-0-60477600-1507939764.jpg


  • Bikerdude, AluminumHaste, Aosys and 1 other like this

#6 freyk

freyk

    Advanced Member

  • Member
  • PipPipPip
  • 637 posts

Posted 02 February 2018 - 05:02 PM

There is also a tdm wiki-article:
http://wiki.thedarkm...ersion_&_Repair

#7 Petike the Taffer

Petike the Taffer

    Member

  • Member
  • PipPip
  • 322 posts

Posted 03 February 2018 - 10:08 AM

Any changes to the fonts will need to preserve the work I did updating the menu fonts for 2.06.
 
post-9-0-72960700-1507939769.jpg
 
 
post-9-0-60477600-1507939764.jpg

 
Springheel, it's actually very fortunate you've mentioned this ! :o B)
 
Now I'm decided about whether I should put off the letter additions/repairs until after 2.06 is released. I should. No point in working with the old font, so I'll still have plenty of time to perfect that for 2.07. In the meantime, I'll practice the procedure, but I'll only edit the font once the updated version is standard.

As for the translation itself, 2.06 will get released with a stripped-down version, largelly without diacritics. (Only for the immediate future, I should be able to fix it by the time of 2.07. Hopefully...)
 

There is also a tdm wiki-article:
http://wiki.thedarkm...ersion_&_Repair


I know of that article and related articles, but it's a bit hard making sense of them.

usually to edit fonts you get the original true type font, use a free font editor that can load and save true type fonts, edit the font the way you want, then use the software, it used to be linked in the wiki. to change the modified true type font into the <filename>.dat and <filename>.dds files.


Just the other day, I was discussing good free font editors capable of this with Bikerdude and skina.

I still haven't found one, so if anyone has successfully used some software suited for the role, I'm all ears.

Edited by Petike the Taffer, 03 February 2018 - 10:12 AM.


#8 teh_saccade

teh_saccade

    Advanced Member

  • Member
  • PipPipPip
  • 630 posts

Posted 11 February 2018 - 06:54 AM

Petike - I was investigating the fonts last year or so and they are merely, as stumpy has said, .ttf that are renamed .dat and .dds.

Could never figure why there were also packaged as teh .dds, unless it was either for compression or for mapping (not level mapping, like... normals / specular or whatever). The .dds don't appear used by the game, but idk jack.

I can't remember if it was you who was doing the Russian translation - from the sounds of it probably not - but there are not many fonts that will jibe with TDM that support Cyrillic characters:
http://www.wazu.jp/g...Fonts_CyrS.html

A few stick out (eg, Arbat) as in-line with the game, but most are... not that great. It's a problem. Mostly, for subtitles, some unicode sans-serif / arial is good enough.
Most are designed, bespoke. Check out vk.com typographic groups, perhaps.

As for diacritic marks, the choice is even more limited for universal support utf-8:
https://collab.its.v...itic Fonts.html
You will be able to find other OS from that link.

In wanting to make a series of cyphered messages, it required simple problem solving for the player only - which might've been an annoying puzzle - so I wanted to make a fake language or series of glyphs representative of English letters that the player would have to decode using a codex, found as part of an objective.

I use a piece of kit called "Glyphs" that is decent for digital type-foundry - if you have inkscape or illustrator, it would be possible to convert by scanning even handwriting (or old books) into vector format and import these vectors into a font-maker.

Glyphs is a few hundred quid, though...

A good, free digital type-foundry - that also allows for this process of scanning rasterised (bitmap) lettering to vector, or importing inkscape/illustrator vector glyphs/letters (I believe) to .ttf (to .dat) for use in the game might be:
https://birdfont.org/

It has tutorials and I've heard good things.

Idk if it can import and rip .ttf's, but... what I do is use my laptop monitor as a lightbox and make the glyph/letter superlarge on the screen and trace it before colouring it black with a sharpie with nice, clean edges (or not...).
Then I scan it and trace it with beziers (good practice to snap them at 45 degrees) or, occasionally - illustrator's autotrace feature sometimes does a decent job. I do not know if Inkscape (free) has this function. I've not used it for a long time and I'm never going back.

However, Inkscape is capable of importing .ttf fonts in order to expand to vector, to copy into a free font editor (I think, can trace a bitmap, at least)..:
http://wiki.inkscape...nstalling_fonts <--- not a problem
https://inkscape.org...dvanced.en.html

One thing to watch out for is the tracking / kerning / leading (space between letters, letters in words and space between lines of text) - there is a section on how to achieve this.

There's a reason why people value decent typefaces at such a high price. It's a fair bit of work.
Personally, I like to collect old wooden and metal block press lettering and press the glyphs and filigree and scan that to use... like a printing press. Placing the letters one at a time for more control. Plus people don't recognise the font. I even use gallium metal to cast my own, if required.

It might be worthwhile taking a look through the myriad font sites that offer free for non-commercial use fonts, such as:
http://www.fontspace...gory/diacritics

TTF RenderText Blended fonts will support ASCII characters (which is why some of the free fonts that say "diacritic" might not show up with the correct markings), but if they are unicode then it is likely it may likely appear as [] in whatever.

If there can be no suitable font found - I'd say that using a free piece of kit such as Inkscape to draw (or trace from bitmap) the lettering, to export / copy-paste as vector into Birdie, to set up the font - then export as .ttf to rename as .dat would be the free-route to achieving your goal.

Using this work-flow, there's no reason as to why the existing fonts might not be altered to include the extra marks you require for your translations.
Just gotta add a few dots and some squiggles in a similarly degraded look, or remaster the entire waterfall for consistency. Or transliterate.

Steep learning curve, lots of swearing in frustration, hard to understand... much like the vast majority of TDM/DR wiki;)

 



#9 teh_saccade

teh_saccade

    Advanced Member

  • Member
  • PipPipPip
  • 630 posts

Posted 11 February 2018 - 06:55 AM

I might have that bit about ascii and unicode backwards... i'm not sure. It's definitely one or the other.

 

// i'd say google it but it's probably irrelevant.


Edited by teh_saccade, 11 February 2018 - 06:56 AM.


#10 Petike the Taffer

Petike the Taffer

    Member

  • Member
  • PipPip
  • 322 posts

Posted 13 February 2018 - 03:45 AM

I might have that bit about ascii and unicode backwards... i'm not sure. It's definitely one or the other.

 

// i'd say google it but it's probably irrelevant.

 

Thing is, my preferred method would be editing the .dds of the individual fonts (only where needed) and then saving those (or, if needed, converting them to the needed format afterward). I am actually capable of opening .dds files in Paint.net.



#11 teh_saccade

teh_saccade

    Advanced Member

  • Member
  • PipPipPip
  • 630 posts

Posted 13 February 2018 - 02:16 PM

Are you able to actually open the .dds files in paint.net..? It's not a bitmap - it's a hack-wrap.

Spoiler


It won't parse for me - the .ttf renamed as .dds won't parse in ANY image editor, because it is not a bitmap - it's simply a .ttf renamed so the game engine can snag it using arcane or pagan magic of some kind.

TL;DR - use a .ttf editor and, if it won't import and/or you can't draw - trace it, either over (insert glyph under and trace/alter) or under (print the glyph onto thin paper-stock and stick it on your screen and trace/alter).

Even though .dds is a bitmap format - it appears that it's merely used as a hack-wrap for the font in this instance so that TDM can understand it. Same as the .dat (which is the convention used in pretty much every TDM FM).

As an alternative, if the idea of doing things the easy way is intimidating - it might be worth checking out the old Doom3 font.dat editor:
https://github.com/Zbyl/BFGFontTool
which would make the process only a little more complicated.

Perhaps you might find Fontforge easier to use, as it can add accents to existing fonts:

Here's an alternative workflow that might prove easier for you (bring the pain!).

1. Copy the font.dat you want to edit to your desktop.
2. Rename the font.dat to font.ttf.
3. Install the font by double-clicking the .ttf.
4. Open Inkscape and add the character from the font you wish to edit.
5. Expand the font [object] to path [vector] (ctrl+shift+C) - a tutorial on the process is here: http://studios.clock...d-text-inkscape <--- only need to do the expand - but, the more you know... // not g, sorry.
6. Export the vector as .svg, ready to import into Fontforge.
6a. You will need to do this for each and every character you want to alter, individually; I'm not sure there's a way to batch this using these programmes.
7. Import vector from inkscape into Fontforge - a tutorial on the process is here: https://fontforge.gi...ortexample.html
7a. If you're up for a challenge, or for some reason the font doesn't correctly appear, printscreen the character and trace it, manually or with the... "tool" provided: https://inkscape.org...tracing.en.html
8. Use the imported vector [character].svg in Fontforge and add the diacritic you need: http://designwithfon...nd_Accents.html <--- grab Fontforge from git from this link.
9. Rinse and repeat - I can't remember if there's a way to add (alternative) characters to a font using Fontforge, or if you'll have to do every character from the original .ttf.
9a. Don't forget to take into account the technical stuff for character spacing, etc..: http://designwithfon...nd_Kerning.html
10. Export the new font you've created as [font]_sl_24.ttf. Hopefully it'll install so you check it out (either in text editor or as html in browser). Rename to .dat and test it in a readable.
11. Maybe the font can be patched to include the additional characters, but do not believe it would be necessary as you've essentially created a well and accurately-crafted version of the existing typeface, no spacing errors. There's a wiki article about that somewhere.
12. Job's done, pat yourself on the back.
13. For good luck - take a 13.

That's it - it's a bit of a learning curve, will take time, but it's the way I'd do it.

From this point on, I'm pretty useless to you wrt to fonts in TDM.
That's the extent of my typographic skill and knowledge and problem solving ability.

You're not simply "cleaning" up a typeface using a click of a button and a few coding commands - what you're doing is editing the font, like a real typesetter. As how it was made, originally.

In fact, you're creating a new version of the font.
Kudos.

----

Spoiler


All I figured about the fonts is that they're .ttf that are renamed to .dat and they work if you do that.
Therefore, instead of working with the extension in a bitmap editor (which doesn't work, as it's a renamed .ttf and not a bitmap, in case I didn't mention that yet) - it makes sense to make alterations to the source, as there may be more to it opening up what may or may not be able to be converted to bitmap and chucking a few dots over it before flicking that bitmap back to a .ttf to format (either using xml or a free font editor...) and rename to .dat or .dds.

Which'd be a fucking nightmare.

All the fonts are .ttf.
They're simply renamed so the game engine can use them.

That's all there is to it.

If it was a case of simply editing a bitmap image - I wouldn't have taken the time and gone to such extent to explain the process of how I would do all this if I had to...


Sorry, mate - sometimes you gotta just "grab the uplay and bite the pillow".

I can't be more concise than this.

If you need any help understanding any of this - ping and I'll lend what assist I can, depending available; plate's full.

GLHF


Edited by teh_saccade, 13 February 2018 - 03:37 PM.

  • Petike the Taffer likes this

#12 teh_saccade

teh_saccade

    Advanced Member

  • Member
  • PipPipPip
  • 630 posts

Posted 13 February 2018 - 02:35 PM

forgot. The characters you'll need, other than your own:

 

!"£$%^&*()_+.-./#1234567890;:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]`abcdefghijklmnopqrstuvwxyz{|}~

 

(maybe not currency, since it's usually "gold/silver/copper pieces")

Valentine's Rose: @~8~~~
Penis: 8==D
Breasts: ( . Y . )
etc...

(super important for readables)

For .dds font, with shaders and specular maps and stuff - usually it requires something like this:

http://www.rastertek.../dx10tut12.html

So - not knowing how TDM handles fonts, I'm starting to think that the .dds is included as alternative hack-wrap for game engine and not for including such things for fonts to display in-game. (maybe i'm wrong, but idk about that stuff, really - esp. not with TDM)

Thanks for helping me kinda figure that one out... can scratch that off the list of things that keep me awake at night:P


Edited by teh_saccade, 13 February 2018 - 02:37 PM.

  • Petike the Taffer likes this



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users