diasurgical/devilution

About translation

uwodb opened this issue · 37 comments

uwodb commented

Hello. I have made some fan translations of Blizzard's games(WC1/WC2/WC3/SC1/SC2 Mass Recall).
If I modify this devilution source, can I print double-byte character in Diablo I? This is the best solution for all language support.

I can edit ctrlpan/smaltext.cel to print less than 100 letters, but I want to display more than with a minimum of 200 and a maximum of 2000 letters. I want to use another font file(Diablo III font, use 2000+ letters) or bitmap(ui_art\font16g.pcx, use 255 letters) instead of smaltext.cel. If the font problem is solved, Diablo I localization will be easier for each languages. Please, advise me if you are interested in that.

Translation support is planned for DevilutionX, see diasurgical/devilutionX#66

Supporting Unicode isn't trivial because of the bitmap fonts and also the way the font rendering is done. It wouldn't be unrealistic to support Windows-1252. More then that would require some more drastic changes.

uwodb commented

Thank you for your assistance!
diasurgical/devilutionX#66
#32
I actually checked these before writing the last post. It would be better to compile devilutionX than hex edit diablo.exe. Because it is possible to increase sizes of that strings and use all the 128-255 letters. Before I started working, I wanted to check if devilutionX supports double-byte characters.

Here is example. What do you advise me to do? Thanks.
https://github.com/uwodb/storycraft/blob/master/test

When the bitmap fonts are used multi-byte text (or any other form of Unicode) isn't supported. Only Windows-1252 is supported, and it is only partially implemented (in the font file).

Technically you could pick any 256 char you want and put them in a font set, for example you could swap Windows-1252 for ISO-8859-5 to make a Russian version of the game, the down side here is that if they pay multiplayer with some one that has a Windows-1252 font set then it will look like they are just writing gibberish.

You could also make an extension of Windows-1252, there are about 40 unused symbols, the down side is that you won't find a text editor that will let you easily write in this custom font.

But for any text that uses an actual ttf font there should already be Unicode support, but currently this is only the case for the credit and the "cancel" button when you join a multiplayer game. It probably not to hard to replace the in game text with a ttf font, but then it would affect the look of the regular text in the game.

Also as mentioned in the other issue I suggest implementing multi language support instead of language specific exe files. The language could then be set in the ini and there won't be odd incompatibilities when playing multiplayer.

uwodb commented

Hmm. Okay. My purpose is to play in Korean to enjoy the lore(single-player). I didn't consider multi-player.
If you could use other fonts instead of smaltext.cel, it would be easy to work and perfect translation including multi-player!
What I want is "replace the in game text with a ttf font," Can you teach me how to replace? Or do I have to wait for your next release?

The string of Diablo I is built into the diablo.exe. It would be better to wait for your multiple language support of devilutionX than my hex editing. Thank you.

Looks like Korean was actually barely supported by any 8bit code page. So yeah Unicode support (and thereby TTF) would be your best bet here I think.

Getting the text strings out of the exe and ready for translation (via po-files) shouldn't be a huge task. But this would still not allow us to render anything that isn't covered by the build-in Windows-1252 (an only partial at that) font. I'm not sure when or how that would be solved, but the best thing you could do would be to find a good alternative font.

The best option would be to have a font designer create a font that closely matches the original. This is possible now since modern fonts support colors. If the look matches the original it would be non-controversial to replace the font rendering to use it instead.

uwodb commented

I'm sorry for my poor English because I am not a native English speaker.
you said, "If the look matches the original"
Unable to use windows-default or Diablo 3's font? I expected it will be able to use any ttf fonts(example: Times New Roman on credits screen)

Anyway, I hope resolve font problems, to let it be translated to any languages. I want to translate devilutionX into Korean and Japanese. Thank you for your advice :)

The ingame font looks very different from any of the default Windows fonts, and the Diablo 3 font is probably not free to distribute.

image

If you can help find a font that we can use that looks the same that would help us work on making the game translatable.

uwodb commented

Ah, I get what you mean. You want to keep the original. Is that right?

StarCraft 1 solved this way when it supported Korean language. Original SC1 font + Korean gothic font
http://1.bp.blogspot.com/_1k7E6o0Zm_U/TU5tSx2DVrI/AAAAAAAAAAU/jKJ1uwo5_mw/s1600/0.png
0000 to 00FF (256): English letters, numbers, and some symbols printed StarCraft fonts. (example: (S), (C), Version 1.16.1)
1000+: Korean letters use the Windows's default font, ttf file.
DevilutionX program can use this way in double-byte processing phase.

https://www.urbanfonts.com/fonts/AvQest.font
https://www.whatfontis.com/FF_Diablo-Heavy.font
I searched for two fonts similar to exocet, but I can't check if it is commercial or if it is edit permission.

It's not quite that simple, a lot more then English exists in the first 256 symbols.

I think what you are referring to as double byte is what is know as UTF-16. We would probably go with UTF8, both however are just encodings for Unicode. Also keep in mind that DevilutionX doesn't just support Windows, I my self run Linux. This isn't really related to the issue though.

What you are describing is font fallback. It is handled automatically by the TTF font rendering engine.
The problem is that Diablo's original font is a simple bitmap and not a TTF font. So it's rendering is very primitive and doesn't support things like font fallback or more then 256 symbols. That is why we need to find or create a font that looks like the original but is a TTF so that we can use a real font rendering engine. Once that is done we can render any language with out doing any further work.

In short what we need is a TTF version of the Diablo font.

It is important to us that the game looks like the original from the 90's first of all. So we want to take it slow with new features to make sure that things are done right.

No, that is a similar but much simpler font, it might be usable as a starting point.

This is what the font should look like given the color #7f7140:
image

Your suggestion looks like this:
image

uwodb commented

I can modify or build .ttf fonts by FontForge, but I didn't buy Exocet(Diablo I's font).
https://www.myfonts.com/fonts/emigre/exocet-ot?tab=licensing
Without Exocet font, nobody can have the same result as Diablo font.
I think you have to choose between Exocet and ttf.

I suggest you make two separate version.

  1. English(+some european languages) Version = uses bitmap, don't change
  2. International Version = new ttf font that free to edit and distribute
    What do you think about this?

The font will cost $390.00 for us to use

qndel commented

image

uwodb commented

Maybe we should find another way to solve this problem.
Anyway, I think your advice will go a long way. Thank you.

Maybe you can help with figuring out how to enable shading (antializing) in FontForge?
https://fontforge.github.io/bitmapview.html#Shades

This is a tricky problem, and one I previously warned for on another thread. Translating for Asian languages will be even more of a challenge, because it will require a dimension-equivalent font to Exocet, and there aren't many libre licensed fonts supporting Korean characters in particular.

My suggestion, for starters, and if translation support is to be taken seriously, is to hire a professional font designer to create a TrueType Exocet clone. He or she could be paid through crowdfunding, and the benefits form having a libre Exocet equivalent would be many, given that it's a popular font-style both within and outside the scope of video games. Given proper interest and funding, it could further be expanded to Asian characters and beyond. This project has enough followers that even small individual donations could allow for this to become a reality.

@sheepo99 what issues would there being with the game using the system font at the requested size?

By system font you mean the golden Exocet-derived bitmap font, or a default TrueType like CharisSilb being used in the credits?

because it will require a dimension-equivalent font to Exocet

Honestly, my 2 cents? Just rip the fonts from diablo 2. It was translated to like 10 different languages, including JAP/CHI/KOR. The fonts also look nicer than d1's fonts. The only issue then is changing strings to unicode.

I couldn't find many good screenshots, but some of the font packs are hosted on the phrozen keep:
https://d2mods.info/forum/viewtopic.php?t=62982

Also it seems with pictograph languages some things were still written in english.

@sheepo99 system (operating system like Windows /Mac) font refers to other fonts installed on the computer. Like I mentioned previously if a symbol isn't found in the game font then the font rendere can load it from the default system font.

Honesty paying the 390$ for Exocet is probably cheaper then paying someone to make a clone.

About converting to unicode, that really isn't an issue either, the only string that isn't already UTF-8 compatible is the title text because of the copyright symbol, and that's trivial to convert.

Honesty paying the 390$ for Exocet is probably cheaper then paying someone to make a clone.

Can it be used commercially in such case (paying this small payment)?

qndel commented

@galaxyhaxz mu wings in diablo? what blasphemy is this? I'd play the shit out of it! :D

Here is another font that is similar and free https://www.1001freefonts.com/av-qest.font

I asked:

Honesty paying the 390$ for Exocet is probably cheaper then paying someone to make a clone.

Can it be used commercially in such case (paying this small payment)?

... of course I mean using it non-commercially.

@AJenbo answered:

https://www.myfonts.com/viewlicense.php?lid=1987

This is Exocet mobile App EULA. But there is also the font's generic Licensing Options, mentioned by @uwodb earlierly. In the case of mobile apps:

App: for embedding in mobile applications

Select this license type when you are developing an app for iOS, Android, or Windows Phone, and you will be embedding the font file in your mobile application’s code.

This font’s app license is:

Pay Once

Unlimited installations of one app title across all platforms such as iOS, Android, and Windows Phone.

And for a Desktop use case this would also be relevant:

Desktop: for use on a desktop workstation

For the most common uses, both personal and professional, for use in desktop applications with a font menu.

For example:

  • Install the font on your Mac OS X or Windows system
  • Use the font within desktop applications such as Microsoft Word, Mac Pages, Adobe InDesign, Adobe Photoshop, etc.
  • Create and print documents, as well as static images (.jpeg, .tiff, .png)

Desktop licenses are based on the number of users of the fonts; in other words, the number of computers in which the font will be installed. You can change the number of users by clicking the quantity dropdown option on Buying Choices or Cart pages.

... devilution on desktop being the second example.

And Exocet Desktop EULA says:
https://www.myfonts.com/viewlicense.php?lid=2055

  1. The Emigre Font Software is licensed for use at one (1) location with a maximum of five (5) devices.

  2. Use of the Emigre Font Software at more than one (1) location or with more than five (5) devices requires a Multi-Device Site License upgrade. A device may be, but is not limited to, a printer, rasterizer, video display terminal, CPU, laptop, workstation or any device where the Emigre Font Software is rasterized or the display of the Emigre Font is generated, or any technology that allows anyone to edit or compose text. For example, but not limited to, a display terminal shall be considered a device if the Emigre Font outline is embedded or otherwise included for viewing or other use by end users by means of a multimedia CD, video game, tablet-type computer, smart phone, computing device, e-reader, manufacturing devices or other means by which the Emigre Font Software can be displayed or used.

  3. Except as permitted herein, you may not modify, convert, adapt, translate, reverse engineer, decompile, disassemble, alter or otherwise copy the Emigre Font Software, or the design of the type font embodied therein. You are permitted to make one backup copy.

[...]

  1. The Emigre Font Software is licensed for use at a single location for use with a maximum of five (5) devices. The Emigre Font Software may not be shared between locations or business entities. Each additional location and/or entity must purchase a separate license to be used in accordance with the terms of the Emigre Font Software License. License upgrades may be purchased for use with additional devices. The upgrade price is calculated as a percentage of the original price of the software. To determine the number of devices, add up all CPUs, workstations, printers, and other devices that use the fonts.
    The following is cumulative:

1 - 5 devices (standard license)
6 -10 devices: add 50 percent
11-50 devices: add 20% for each 5 devices
51-125 devices: add 15% for each 5 devices
126-250 devices: add 10% for each 5 devices
over 251 devices: add 5% for each 5 devices

Very large or unlimited uses of the Emigre Font Software require a custom license agreement; please send an email to: sales@emigre.com to discuss your needs.

This doesn't look viable. So in the case of Exocet font either devilution (1) proves that the desktop app is the same category as the mobile app or (2) gets some custom license in the vein of Public Domain, or (3) doesn't use it in a legal way at all.

There is also Exocet Server EULA which would probably allow downloading the font from a server to render the game content. But:

This license is valid for one year and is renewed each year that the font remains in use.

The price is based upon the number of servers on which the font is installed. Development servers do not count toward the limit. A font downloaded with this license cannot be used in SaaS, where the service is the product rather that the item that is created.

This requires some hosting + at least yearly maintenance, so a no-go. And SaaS restriction excludes using it for diabloweb too, I guess.

The only practical, still a bit improbable way is to ask for Emigre sales to grant the font for non-commercial use in devilution code put into Public Domain.

@AJenbo responded to @qndel:

No, that is a similar but much simpler font, it might be usable as a starting point.

This is what the font should look like given the color #7f7140:
image

Your suggestion looks like this:
image

It is the bitmap font rendered above + TTF font rendered below, right?
I think this is the heavier version of the same Exocet, only with textures mapped on top.

@sskras

  • Desktop license only applies to installing it as a system font, and then we would need each person to buy and download it before the game would work.
  • No, the server license doesn't allow you to distribute the font.
  • Devilution falls under "mobile" app category because the font is embedded in the game.

It's not the heavy version. It's the normal one with a bevel (that's why it looks heavy) and a texture effect.

There are several weights of exocet free for personal use here: http://fontsgeek.com/fonts/Exocet

As Ajenbo mentioned, an additional effect was added to further give the font texture.

Agreed about bevel, thanks both.

@AJenbo wrote:

Desktop license only applies to installing it as a system font, and then we would need each person to buy and download it before the game would work.

I quoted already that there are two more things. Pasting for reference:

image

  • Use the font within desktop applications [...]
  • Create and print documents, as well as static images [...]

So you haven't convinced me yet why would embedding the font in an Win32 app running on desktop legally convert it to a mobile app.

The desktop license is for what's classically known as desktop publishing. The text you are referencing isn't legal English but an attempt at translating common English. Talk to a lawyer if you need a more detailed explanation.

Here is a comparison of what the 3 fonts look like in-game:
image

To me, there is a noticeable difference if we simply switching to Exocet. This is especially true for the menu text where the font size is even larger.

Exocet light looks ok but still not nearly as nice as the original. Will definitely need to be modified.

Another thing to notice is that the font in diablo uses small caps this isn't the case for Exocet.

For the smaller sizes, there isn't actually a size difference so for the above comparison I just converted all text to upper case, but for the menu text it's quite noticeable especially with letters like "t", here is what the main menu looks like:
image

@AJenbo wrote:

The text you are referencing isn't legal English but an attempt at translating common English. Talk to a lawyer if you need a more detailed explanation.

This is inpolite response at best.

If you are qualified in law enough to identify the degree of legal things in an English text and make law-related conclusions, please don't send your peer to a some other lawyer at first.

If you are not qualified enough, please don't hurry with you law-related conclusions.

Thanks.

Sorry, I didn't mean to be rude. My intention was simply to say that I don't feel I have an obligation to convince you one way or the other.

I have a background in publishing so I do have experience with what you can and cannot do with fonts as well as the technical aspects of the font/text layout. Take it for what it's worth.

This topic has gone off track and is beginning to be more of a discussion forum than an issue description. In short, we know what needs to be done in order to enable translations that can't be done satisfactorily with Windows-1252, but it is not on the roadmap for the foreseeable future. If you want to discuss this topic more I suggest Discord or some other forum.