ENIGMA Forums

General fluff => General ENIGMA => Topic started by: sorlok_reaves on November 30, 2014, 03:37:08 pm

Title: Quick question on fonts
Post by: sorlok_reaves on November 30, 2014, 03:37:08 pm
Hey all,

Just a quick question on fonts. I compiled An Untitled Story using a bunch of custom fonts, and when I copied the executable over to another machine, the fonts "just worked". This is by design, right? What I mean is, I don't have to worry about distributing the fonts with the game, right?
Title: Re: Quick question on fonts
Post by: Rusky on November 30, 2014, 04:31:37 pm
I believe the fonts are turned into sprite sheets at compile time.
Title: Re: Quick question on fonts
Post by: sorlok_reaves on November 30, 2014, 05:02:38 pm
Excellent! That's what I was hoping, thanks.
Title: Re: Quick question on fonts
Post by: Goombert on November 30, 2014, 06:23:09 pm
Yes, exactly as Rusky stated, we convert them to a sprite sheet and build them into the executable, this was in fact by Josh's design.
Title: Re: Quick question on fonts
Post by: TheExDeus on November 30, 2014, 07:02:18 pm
Fonts are rendered on textures on compile time (done by LGM), which is then added to the executable as any other image data. One texture is generated with all the requested glyphs on it, then the texture positions of all glyphs are saved, which are then used for drawing. That is how GM does it as well. We sadly don't support loading fonts from external files right now. There was talk on how to do this with some external libraries, but nobody wanted to use 3rd party stuff it seems.
Title: Re: Quick question on fonts
Post by: Goombert on November 30, 2014, 08:01:54 pm
We don't actually need 3rd party libraries for generic font_add, WinAPI has it built in and stuff, but we may need a library for TIFF or whatever format it is, if I recall TIFF files or whatever are only supported on Windows for Studio or something like that, I can't even remember the file format off hand.
Title: Re: Quick question on fonts
Post by: sorlok_reaves on November 30, 2014, 10:35:45 pm
Thanks for all the information everyone; now I fully understand what's going on behind the scenes.
Title: Re: Quick question on fonts
Post by: Darkstar2 on December 08, 2014, 08:36:59 pm
Yes, exactly as Rusky stated, we convert them to a sprite sheet and build them into the executable, this was in fact by Josh's design.

and that's the way to avoid font dependency and legal issues.  From what I know GMS now supports TTF rendering, and if not mistaken they do embed the fonts in the EXE, some are (c) so I wonder if they do so illegally or only do so for non (c) ones....
Title: Re: Quick question on fonts
Post by: time-killer-games on December 08, 2014, 11:25:33 pm
DS2~ fyi fonts that are copyrighted and used without the authors permission are always illegal, whether the font is in its  original TTF format or is converted to a texturepage, just as illegal regardless of the format, if it isnt your property, it just isnt, end of story.
Title: Re: Quick question on fonts
Post by: Darkstar2 on December 09, 2014, 12:29:25 am
DS2~ fyi fonts that are copyrighted and used without the authors permission are always illegal, whether the font is in its  original TTF format or is converted to a texturepage, just as illegal regardless of the format, if it isnt your property, it just isnt, end of story.

lol - if that were the case then a lot of microsoft word users are breaking the law.  So by that definition if I use a font in word and print a document I am illegal ? If it were illegal don't you think many companies would be trouble ? All those developer tools with fonts support, illegal too ?

Title: Re: Quick question on fonts
Post by: Goombert on December 09, 2014, 12:45:58 am
No it's the copyright of the font TKG, the ones in word are likely free or permissive DS2, and I do believe changing the format can sometimes get around that TKG, such as if it were vector instead of bitmap.
Title: Re: Quick question on fonts
Post by: time-killer-games on December 09, 2014, 12:56:09 am
DS by "permision" as in counting public domain, free for personal/commercial use, and royalty free. :p as robert just stated, I am right, converting it to a texture page, which isnt a vector graphic, wont change who's the copyright holder or their terms.

My brain just exploded trying to read these posts I'm going to bed nighty night peeps!
Title: Re: Quick question on fonts
Post by: TheExDeus on December 09, 2014, 10:18:21 am
Quote
lol - if that were the case then a lot of microsoft word users are breaking the law.  So by that definition if I use a font in word and print a document I am illegal ? If it were illegal don't you think many companies would be trouble ? All those developer tools with fonts support, illegal too ?
How many fonts in the MS word are under monetary license? The answer is 0, because if there were, then they wouldn't be included in word or windows. For most fonts MS owns the copyright. Also, you mistake copyright with license. Copyright doesn't mean that you can't use it, it means you cannot say "I made it" and even worse, get money from that without consent of the copyright holder. Which basically means that the copyright holder has the main right to decide on who can and cannot use his work. Licenses on the other hand can be all different kinds, like GPL or MPL or BSD or whatever. This means that you can make a font, for which you automatically hold a copyright (under Berne Convention you get a copyright automatically and there isn't a process in which you need to get it), and then you can release that font freely with a license saying that anyone can copy it, modify it, and even sell it. If you don't allow a person to sell it, but they do, then you can get compensation and/or get them to stop, because you still hold the copyright no matter the license.

So normally you can still enforce the license even if the person has converted your vector font to a bitmap one. But that depends on the license.
Title: Re: Quick question on fonts
Post by: Darkstar2 on December 12, 2014, 12:44:16 pm
BTW as  to MS word it uses all available/usable fonts you have installed on system, it does not restrict.....

As to FONT copyright and it's use, you are not allowed to SELL IT, true, but what I was wondering, what if I used a given font in my game, to write score or text and sell my game.....I am not directly selling the font but my game which happens to use a bitmap representation of the font, would I be illegal in the hands of the FONT (c) holder?  I am not embedding or distributing the font itself so it would have no use for the person playing my game and would not even be considered a "FONT" but a bitmap/texture map whatever.

Title: Re: Quick question on fonts
Post by: TheExDeus on December 12, 2014, 01:31:33 pm
Quote
BTW as  to MS word it uses all available/usable fonts you have installed on system, it does not restrict.....
I know that. But there are already hundreds of pre-installed fonts, all of which are free to use as you please.

Quote
As to FONT copyright and it's use, you are not allowed to SELL IT, true, but what I was wondering, what if I used a given font in my game, to write score or text and sell my game.....I am not directly selling the font but my game which happens to use a bitmap representation of the font, would I be illegal in the hands of the FONT (c) holder?  I am not embedding or distributing the font itself so it would have no use for the person playing my game and would not even be considered a "FONT" but a bitmap/texture map whatever.
As with anything it depends on the license. If the license says they are free to be used, then you are free to use them. There is no single "font law" or something. There are many font sites which allow you to get them for free and use commercially (like google fonts here: http://www.google.com/fonts) or you can buy a commercial license that allows you to include it in your product as a bitmap here (http://www.losttype.com/ with license http://www.losttype.com/images/samples/License_Commercial_Sample.pdf). You can see that in the last example you can only install the font and use it on 1-5 computers (with the cheapest license), but you can include it in your final product, which would mean converting it into a bitmap and using that way for games. You can probably give the font file with the game itself as well, but only if it doesn't explicitly install it for the users. In this case the safe way would be to use the bitmap version.