|
|
Josh @ Dreamland
|
|
Reply #2 Posted on: February 19, 2014, 10:22:06 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Presently, LGM does the glyph rendering. Support for that much is iffy, but it should be easy to patch. So basically, Harri is correct. However, there's more to this problem.
The underlying issue here is that GM/ENIGMA use sprite fonts, so including all of unicode can't happen, which is why we need you to pick a range at all. I don't own GM:S; how did you specify the Cyrillic character range in it? If we know that, we can offer a similar mechanism.
The overlying issue is, due to this problem, we haven't chosen an encoding. What does the string you are trying to draw look like? Is it literally [snip]"Привет, мир!"[/snip]? While we haven't yet decided on an encoding, our go-to encoding is UTF-8. The string literal is stored in UTF-8 in our save format, and written as UTF-8 for compile, so ultimately, you'll get UTF-8 in memory.
What Harri missed is that if we do embrace UTF-8 as our encoding (which is preferable anyway, as it is more flexible), we have two new questions: 1. Who is parsing the UTF-8 for single characters? This is easy to do, but there's only one correct answer: ENIGMA. 2. How are we storing ranges? Sparse storage (a map of wide characters to glyph texture locations)? Dense range (an array with an offset and length)? Sparse ranges (a map of dense ranges by first glyph)?
All of these will be answered, but first we need to know how you as a user specify you want a given range.
|
|
« Last Edit: February 19, 2014, 10:23:47 am by Josh @ Dreamland »
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
Goombert
|
|
Reply #3 Posted on: February 19, 2014, 10:52:48 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
The underlying issue here is that GM/ENIGMA use sprite fonts, so including all of unicode can't happen, which is why we need you to pick a range at all. I would like to go ahead and dispute that. How big of an issue is it really? Because once they are packed and sized up to a power of two texture, they still leave fucktons of space left on the texture anywho. People don't generally use very big fonts to render generic text either, if they use big fonts it's usually in a logo. To be honest, once texture atlasing is added to LGM and then I add it to ENIGMA, I'd be perfectly fine if ENIGMA just rendered all character ranges. I mean fuck we're talking about a few kilobytes. Here is information on Unity3D which explains what they do. http://docs.unity3d.com/Documentation/Components/class-Font.htmlSparse storage (a map of wide characters to glyph texture locations)? This is what Studio does now, see the function sprite_add_font_ext http://docs.yoyogames.com/source/dadiospice/002_reference/game%20assets/fonts/font_add_sprite_ext.htmlBut anyway, I can add Charset as an option to the font editor for him. Since GMK and GMX support the property but just don't show it in the editor. Edit: actually good news, you should be able to hack around Java's font properties in order to enable Cyrillic fonts. https://www.multilingual.com/articleDetail.php?id=540
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
TheExDeus
|
|
Reply #4 Posted on: February 19, 2014, 10:59:16 am |
|
|
Joined: Apr 2008
Posts: 1860
|
I'd be perfectly fine if ENIGMA just rendered all character ranges. I don't think you understood what Josh meant by unicode. Unicode has 110187 characters... do you really think it will be practical to render them all on one texture? Even if on average one character would be 8x8 pixels (tightly packed), it would still end up 7051968 pixels and that is a minimum 2656x2656 texture, probably rounded up to 4096x4096. Maybe one texture like that would be possible. But most usually you just require certain ranges. Is it literally "Привет, мир!"? Probably as that is just "hello world" in russian. The first screenshot is from GM where it is drawn correctly. but first we need to know how you as a user specify you want a given range. GM also still used 0-255 ASCII as far as I know. In GM8 it just had different charsets as different fonts. So while in LGM I have "Arial", in GM I could choose "Arial CYR", "Arial Baltic", "Arial Greek" and so on. In newer GM I think they just have a dropdown list for that. So to fix basic problems with charsets you could just still use ASCII. The ENIGMA screenshot does seem to show several more characters than the original string. That leads me to believe it is still parsed as ASCII while the coding is in utf.
|
|
|
Logged
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #6 Posted on: February 19, 2014, 11:31:49 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
I'm assuming at least Harri is aware of this, but to clarify, it'd be stupid to include a whole unicode texture in every game. As an option, okay, maybe, at the user's own peril. A reasonable font size would put the texture well past even the high-performance GPU maximum texture size, and I really don't want to ugly up the code supporting users who want to include all unicode characters in their game. There's no rhyme or reason to it.
I believe you're trying to confirm my fears, Harri, that GM uses 0-127 ASCII and 128-255 user-specified (eg, Cyrillic). Yes? That's terribly inextensible, but would, I guess, allow us to use 0-255. But the fact remains that we use UTF-8 to store our data, and that string will be just that in memory, so processing on ENIGMA's side is going to be required. Somewhere, we'd have to find ANSI-like encoding for unicode chars in string literals, which is filthy. I'd much rather just support unicode and have users choose ranges therein, even if we have to give an interface that picks those ranges for them.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
Goombert
|
|
Reply #7 Posted on: February 19, 2014, 11:34:03 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Jash, look at the font editor, LGM's new one lets you pick multiple ranges. Also, Arial Baltic and all that shit just looks like regular Arial to me, I see no difference in Studio's font editor. For instance I only get Cyrillic fonts in GayMaker 8.1 Standard when I select Russian Charset.
|
|
« Last Edit: February 19, 2014, 11:37:14 am by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
TheExDeus
|
|
Reply #8 Posted on: February 19, 2014, 12:36:59 pm |
|
|
Joined: Apr 2008
Posts: 1860
|
Also, Arial Baltic and all that shit just looks like regular Arial to me, I see no difference in Studio's font editor. I don't know what editor you speak of. I only have 8.0 installed and there I can't even select character set. Arial CYR, Arial Baltic and so on only change 127-255 (the extended ASCII table). That is the same as choosing the character set in 8.1. It won't change the basic letters (32-127) at all, so you won't notice any changes if you don't use the extended table. I believe you're trying to confirm my fears, Harri, that GM uses 0-127 ASCII and 128-255 user-specified (eg, Cyrillic). Yes? Yes. It has been like that for years and is the only reason why GM ever allowed translations.
|
|
|
Logged
|
|
|
|
time-killer-games
|
|
Reply #9 Posted on: February 19, 2014, 01:13:30 pm |
|
|
"Guest"
|
As long as ©, ∞, and • are included with all the other common ones, I'm perfectly happy.
|
|
|
Logged
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #11 Posted on: February 19, 2014, 02:55:26 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
I think our best bet, then, is to use the "sparse ranges" storage method I named above, and let users choose the characters.
I'll point out that unicode contains logical groupings of common symbols. For example, A0-FF contain the Latin-1 symbols, which encompasses some of TKG's wishlist. Latin-1 block: ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ.
The bullet character is in with "General Punctuation," the block of unicode 2000 - 206F. These include a whole range of obscure punctuation marks, including the somewhat comical interrobang, and the common ellipsis.
The infinity character is in with the math symbols, unicode 2200 - 22FF. This contains every mathematical operator you can name, and a few that you can't.
Those three blocks total almost 500 characters. So we could allow checking an enable box for those ranges, but they'd bloat quickly, especially as users got checkmark happy.
What we could allow instead is a box for users to input characters they need. We'd then build a map from the chars in those boxes. But having checkable ranges is a good perk, nonetheless.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
TheExDeus
|
|
Reply #13 Posted on: February 19, 2014, 05:23:22 pm |
|
|
Joined: Apr 2008
Posts: 1860
|
Harri, are you blind, the screenshot shows the option in 8.1 Then you are stupid, because how do you expect to see difference in extended ASCII font when you only see "AaBbCcDd"? I was referring to the fact that you actually need to see the whole 0-255 range to see the difference in character set. The first 127 characters will ALWAYS be the same. In GM:S I think you actually see every character in the selected range, so you should see a difference there. I just searched for GM:S font dialog and I must say it's quite good. I like the "From code" and "From file" options. It basically scans your code and checks for all strings inside it and populates the font range just to be able to represent your strings. Not only it's useful for things like translations (so if you write in cyrillic the range will automatically include cyrillic), but can also exclude individual characters. So if you never use "A" in your game, then only "A" might be excluded. Sounds like a fun option. It would make some fonts for some games extremely small. I think our best bet, then, is to use the "sparse ranges" storage method I named above, and let users choose the characters. I agree. I would love not only 0-255 but if you just write unicode and it creates a texture with unicode. Then you just loop the strings, find a char in map, and then draw from texture. For now it seems LGM has the hard part here. In ENIGMA we just need all chars to be wide chars and strings as wide strings.
|
|
|
Logged
|
|
|
|
Goombert
|
|
Reply #14 Posted on: February 19, 2014, 07:07:32 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Then you are stupid, because how do you expect to see difference in extended ASCII font when you only see "AaBbCcDd"? I was referring to the fact that you actually need to see the whole 0-255 range to see the difference in character set. Hardly at all, I went and ran the test in Studio, and with 0-255 I noticed no differences between the fonts as you can see in the following image. Ran the same test on 8.1 and didn't notice any differences, until I changed the Charset option to Russian. I just searched for GM:S font dialog and I must say it's quite good. I have to argue ours is less fucking glitchy and doesn't restrict the character ranges. Then you just loop the strings, find a char in map, and then draw from texture. For now it seems LGM has the hard part here. In ENIGMA we just need all chars to be wide chars and strings as wide strings. That's essentially what needs done for font_add_sprite_ext, so similar shit also needs done ENIGMA side.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|