Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Test Builds => Topic started by: m!m on November 15, 2011, 01:22:16 pm

Title: TrueType font rendering
Post by: m!m on November 15, 2011, 01:22:16 pm
I did some experimentations and I have a mostly working TrueType font rendering system for FSO. It uses NanoVG (https://github.com/memononen/nanovg) to render the font which is using Freetype (http://www.freetype.org/) to process the fonts.
Github branch: https://github.com/asarium/fs2open.github.com/tree/feature/ttf-nvg
Test builds: http://www.mediafire.com/download/cpie4xe49h28n6p/FSO-TTF.7z

Example mod: http://www.mediafire.com/download/3nymujuxfglnxrj/fontTest.7z

When could you be interested by this? This patch offers the ability to use TrueType (http://en.wikipedia.org/wiki/TrueType) which is a widely used font standard so you can use any TrueType font you can find for usage in FSO when using this patch. Other reasons why you may want to test this build:

The patch only includes project file updates for Visual Studio 2010 so I would be grateful if somebody could give me an updated version of the project files for earlier versions of MSVS. I also got confirmation that an earlier version of this patch compiled and ran of Linux but it would be great if someone could confirm if this is still the case.
Warning: The patch was created against Antipodes and the test builds are also Antipodes builds

To use TrueType fonts you will first have to move the .ttf file into the data/fonts directory of you mod (create it if it doesn't exist) then you will have to edit the fonts.tbl table or if you don't have one then you can use the newly added -fnt.tbm modular table type.
General table structure:
Code: [Select]
#Fonts
<font entries>
#End

Old fonts can be specified with "$Font" and the filename of the font file. As the new system can also use names for identifying fonts instead of only indexes you can specify a name using "+Name" and some string value.
Example:
Code: [Select]
$Font: font01.vf
  +Name: Font 1

These fonts also support the "+Top offset" and "+Bottom offset" options which allow to specify a pixel-offset which should be applied before and after a line of text is drawn.

TrueType fonts can be added using the "$TrueType" option:
This option takes a filename of a TrueType font as its argument. Nothing more is needed for a basic setup, every following option is entirely optional.

You can again specify a name for easier identification using "+Name" like with the old fonts, if this option is not present then a name is generated (resulting in a name like "<filename>-<fontsize>"). The name has to be unique!

The next option would be "+Size" where you can specify the point size of this font which is the same as in every text editing program. Default is 8.

You can also specify a top and bottom offset for a TrueType font which can be set with "+Top offset" and "+Bottom offset". This will result in a line like the following:
Code: [Select]
||+Top offset||
  <line of text>
||+Bottom offset||
||+Top offset||
  <line of text>
||+Bottom offset||
This can be used to space out the lines of the fonts without having to change the font itself. The value for both options is given in pixels and the default value is zero in both cases.

You can use "+Tab width" to specify the width of tab characters. This width is given in multiples of spaces where 1.0 would be one space character. Default is 1.0.

The next option is +Letter spacing which can be used to change space between to letters.

+Special Character Font: This can be used to specify an old font file which should be used to draw special characters, you should only specify this if you know that you really need it.

Example:
Code: [Select]
$TrueType: arial.ttf
+Name: Arial
+Size: 12

I'd also be very happy if someone with better OpenGL knowledge could take a look at the rendering of these fonts as I'm a complete noob when it comes to OpenGL.

The sequence in which the fonts appear is also important. The first three fonts are used by FSO by default for interface rendering.

This patch also removes the fixed limit of a maximum of 5 fonts so you can now have an unlimited number of fonts.

This is a full example of a fnts.tbl file which includes the three default fonts and a TrueType font:
Code: [Select]
#Fonts

$Font: font01.vf
$Font: font02.vf
$Font: font03.vf

$TrueType: arial.ttf
+Name: Arial
+Size: 12

#End

I tested the patch but there may still be some bugs and/or visual inconsistencies so please test it and report those here.

I also took the liberty to change the "$Font" option in Hud_Gauges.tbl to also accept the name of a font as its value.

Regards,
m!m
Title: Re: TrueType font rendering
Post by: The E on November 15, 2011, 02:27:24 pm
Tested it, seems to work so far.

A few notes though:

1. The requirement that font names be unique is a bit troublesome, because it's not explained properly. I believe a tbl like this:
Code: [Select]
$TrueType: Bankgothic.ttf
+Size: 10

$TrueType: Bankgothic.ttf
+Size: 20

$TrueType: Bankgothic.ttf
+Size: 32

shouldn't cause trouble, yet it does. I think it would be more elegant if you used a combination of font filename and size as a temp name if no other name is given; that should keep things simple and transparent enough, imho.

Second note: Something with this new font code seems to interfere with the F3 lab, the UI code there doesn't really seem to like it. Given that that code is crap anyway, this is not that big an issue though, and I am confident that a solution can be found.

All in all, this is awesome work.

EDIT: Before I forget, can you provide a patch for this against the current Antipodes codebase? Given that AP is going to be merged into trunk soonish, it would be good to not have to convert it then.

EDIT EDIT: I may just be imagining things, but using TTF fonts may actually be faster than using FS2 fonts.....


EDIT EDIT EDIT:

Okay, here's a few more issues:

(http://blueplanet.fsmods.net/E/pics/screen0220.png)
Spaces seem to be getting nommed in conjunction with coloured text

(http://blueplanet.fsmods.net/E/pics/screen0222.png)
Several of the special characters used in the FS2 HUD are missing (no wonder, given that they are special characters created for those cases).
Note that, in addition, the red dots in the wingman display went AWOL; this hints at some strangeness happening in the HUD code.
Title: Re: TrueType font rendering
Post by: Nuke on November 16, 2011, 08:42:48 pm
cool, i can finally use smaller fonts for my scripted hud gauges.


first one looks like a simple parsing glitch.

the second one could probably be fixed with some kind of character replacement feature.

+replace: character index
+with: character index

you would still need to use a font with a similar symbol somewhere in the set. also this might screw up if you ever use a unicode font.

or you could just render those icons procedurally when using a ttf font.
Title: Re: TrueType font rendering
Post by: Swifty on November 17, 2011, 01:56:50 am
Whoa! Awesome job, m!m! What libraries did you use to get the TrueType support? I always thought about integrating the FreeType library into FSO but never got around to doing that. From the patch, it looks like you're using FTGL?

I wouldn't be surprised if FTGL was faster than our font rendering setup. We still use immediate mode to render VF fonts and we don't even bother to batch them which something we could probably do since all characters are all in one texture map.
Title: Re: TrueType font rendering
Post by: chief1983 on November 17, 2011, 02:46:29 am
Hmm, wonder if we could convert VF to TTF on the fly and eliminate the need for the immediate mode renderer.
Title: Re: TrueType font rendering
Post by: Nuke on November 17, 2011, 03:28:27 am
id just have some font guru htl* the **** the current fonts. procedurally converting raster fonts to vector fonts, not so easy, and would probably look like crap.


*yes im using the term incorrectly. bite my fleshy meatbag ass!
Title: Re: TrueType font rendering
Post by: chief1983 on November 17, 2011, 09:36:57 am
Well, the main issue is that there are mods already released with their own fonts.  If we could be certain we found all existing fonts, that might work, otherwise I'm not sure how we could avoid breakage.  Could deprecate older fonts perhaps.
Title: Re: TrueType font rendering
Post by: The E on November 17, 2011, 10:08:36 am
Well, I think what we could do is convert those little graphics to ppms and include them in the source, with possible override via little pngs or something.
Title: Re: TrueType font rendering
Post by: m!m on November 17, 2011, 12:11:06 pm
I updated the patch link with a new patch to an updated version where fonts with no special name get a more unique generated name. I also attached a patch against antipodes which only contains build file changes.

I also think that adding bitmaps for those special characters is the best solution as that would also make further customization of the various HUD options possible.
Title: Re: TrueType font rendering
Post by: m!m on November 21, 2011, 01:00:02 pm
The issue with the spaces in the briefing text should now be fixed, updated links to patch and test builds download. Again a patch against Antipodes is attached.

[attachment deleted by a basterd]
Title: Re: TrueType font rendering
Post by: Mongoose on November 21, 2011, 01:03:29 pm
2011 is now officially The Year of Awesome SCP Additions that Came out of Nowhere. :D
Title: Re: TrueType font rendering
Post by: chief1983 on November 21, 2011, 01:21:27 pm
As well as Additions We Hoped To Release This Year But Probably Won't Get to Until Next Year.
Title: Re: TrueType font rendering
Post by: MatthTheGeek on November 21, 2011, 01:50:15 pm
As well as Additions We Hoped To Release This Year But Probably Won't Get to Until Next Year.
Isn't that every year ?
Title: Re: TrueType font rendering
Post by: headdie on November 21, 2011, 01:55:12 pm
As well as Additions We Hoped To Release This Year But Probably Won't Get to Until Next Year.
Isn't that every year ?

I would say so and tbh I am just glad for the features, bug fixes and optimisations we have been given
Title: Re: TrueType font rendering
Post by: m!m on December 11, 2011, 10:19:37 am
Tab characters are now "drawn" correctly and the width of these can be adjusted. First post has been updated with some documentation about the new option and has new links to the test builds and the patch.
Title: Re: TrueType font rendering
Post by: m!m on January 29, 2012, 12:33:47 pm
I added a feature which lets the modder specify a spacing option for every drawn line so you can space out the lines of a text without having to change the font itself. First post has been updated with new links to the patch and test builds and I also added information about the added features.
ATTENTION: The patch was created against the Antipodes branch and the provided test builds are also Antipodes builds which include the new pilot code.
Title: Re: TrueType font rendering
Post by: AndrewofDoom on January 29, 2012, 10:39:32 pm
Both links are the same fyi. You may want to fix that.
Title: Re: TrueType font rendering
Post by: m!m on January 30, 2012, 04:36:53 am
 :mad: :banghead: :snipe:
Fixed...
EDIT: The last build broke Hud_gauges.tbl parsing, new build has been uploaded...
Title: Re: TrueType font rendering
Post by: AndrewofDoom on January 30, 2012, 08:33:14 am
So I tried it out, and it's very cool. But, has anyone tried to go to the ship selection in the briefing? It seems to CTD for it me when I do that...
Title: Re: TrueType font rendering
Post by: m!m on January 30, 2012, 08:35:09 am
Hmm, doesn't happen on my side. Can you generate a debug log?
Title: Re: TrueType font rendering
Post by: AndrewofDoom on January 30, 2012, 08:07:26 pm
I think it was a corruption in the new pilot code, since it works now after playing a mission that I hadn't last played, so it's all good now.
Title: Re: TrueType font rendering
Post by: m!m on February 02, 2012, 10:57:49 am
Updated patch to apply cleanly to the latest Antipodes revision and to fix some issues which made FSO crash when an illegal font was specified and an issue which drew text wrongly when it was overlapping the lower boundary of the screen.
Title: Re: TrueType font rendering
Post by: Zacam on February 03, 2012, 07:03:24 am
Quote from: SCP IRC Channel
Feb 03 [04:20:33] <ni1s>  little note on the truetype patch, GCC barfs on quilified class functions(foo::bar) inside the class declaration
Feb 03 [04:20:37] <ni1s>  http://paste.pocoo.org/raw/545122/
Title: Re: TrueType font rendering
Post by: m!m on February 04, 2012, 02:31:43 am
Ahrg, sorry that must have slipped in. Patch updated.
Title: Re: TrueType font rendering
Post by: The E on February 06, 2012, 11:03:23 am
Slight oversight: In hudparse.cpp, parse_hud_gauges_tbl(), line 202, you need to call
Code: [Select]
parse_font(Hud_font, "$Font:");instead of the simple parse_font().
Title: Re: TrueType font rendering
Post by: m!m on February 06, 2012, 12:39:13 pm
Links updated for new test builds and a new patch which applies cleanly against latest Antipodes again. I also added some Doxygen documentation to the functions in font.h and the FTGLFont class.
Title: Re: TrueType font rendering
Post by: m!m on February 11, 2012, 06:00:09 am
Patch updated again to fix bug where "1" would get converted to "€" on the hud.
Title: Re: TrueType font rendering
Post by: Echelon9 on February 11, 2012, 09:28:43 am
.....I also added some Doxygen documentation to the functions in font.h and the FTGLFont class.
That gets a big tick from me! Great to see more coders writing docs when touching a section of the codebase.
Title: Re: TrueType font rendering
Post by: m!m on March 12, 2012, 04:29:52 am
New patch along with a test build is in the first post. The changes include finished documentation on all classes and functions in font.h and further bug hunting. The parse system also uses the newly added SCP_string variants of stuff_string so no more fixed sized char arrays!
Title: Re: TrueType font rendering
Post by: niffiwan on April 07, 2012, 05:23:46 am
I wanted to test out the TTF rendering to see if it would fix mantis 2417 - no luck unfortunately but as a side effect here's a patch to update configure.ac for Linux, as well as let it compile on Ubuntu 10.04, 11.10 & Fedora 16.

Please note - the required versions of freetype & ftgl are just what are installed by default in Ubuntu 10.04, it compiled and ran OK so I'm *assuming* that these versions are OK.

Code: [Select]
Index: code/graphics/font.cpp
===================================================================
--- code/graphics/font.cpp    (revision 8645)
+++ code/graphics/font.cpp    (working copy)
@@ -276,7 +276,7 @@ FTGLFont *FontManager::loadFTGLFont(SCP_string fileName, int fontSize, FTGLFontT
 
  if (fontFile == NULL)
  {
- mprintf(("Couldn't open font file \"%s\"", fileName));
+ mprintf(("Couldn't open font file \"%s\"", fileName.c_str()));
  return NULL;
  }
  ubyte *fontData = NULL;
@@ -286,13 +286,13 @@ FTGLFont *FontManager::loadFTGLFont(SCP_string fileName, int fontSize, FTGLFontT
 
  if (!fontData)
  {
- mprintf(("Couldn't allocate %d bytes for reading font file \"%s\"!", size, fileName));
+ mprintf(("Couldn't allocate %d bytes for reading font file \"%s\"!", size, fileName.c_str()));
  return NULL;
  }
 
  if (!cfread(fontData, size, 1, fontFile))
  {
- mprintf(("Error while reading font data from \"%s\"", fileName));
+ mprintf(("Error while reading font data from \"%s\"", fileName.c_str()));
  delete[] fontData;
  return NULL;
  }
@@ -329,20 +329,20 @@ FTGLFont *FontManager::loadFTGLFont(SCP_string fileName, int fontSize, FTGLFontT
 
  if (fnt == NULL)
  {
- mprintf(("Couldn't allocated memory for font object for file \"%s\"", fileName));
+ mprintf(("Couldn't allocated memory for font object for file \"%s\"", fileName.c_str()));
  return NULL;
  }
 
  if (fnt->Error())
  {
- mprintf(("Font loading of font \"%s\" ended with errors! Error code is %d.", fileName, fnt->Error()));
+ mprintf(("Font loading of font \"%s\" ended with errors! Error code is %d.", fileName.c_str(), fnt->Error()));
  delete fnt;
  return NULL;
  }
 
  if (!fnt->FaceSize(fontSize))
  {
- mprintf(("Couldn't set face size of font \"%s\" to %d!", fileName, fontSize));
+ mprintf(("Couldn't set face size of font \"%s\" to %d!", fileName.c_str(), fontSize));
  delete fnt;
  return NULL;
  }
@@ -1131,7 +1131,7 @@ void parse_ftgl_font(SCP_string fontFilename)
 
  if (font == NULL)
  {
- Warning(LOCATION, "Couldn't load font \"%s\".", fontFilename);
+ Warning(LOCATION, "Couldn't load font \"%s\".", fontFilename.c_str());
  return;
  }
 
Index: configure.ac
===================================================================
--- configure.ac    (revision 8645)
+++ configure.ac    (working copy)
@@ -358,6 +358,16 @@ PKG_CHECK_MODULES([PNG], [libpng >= 1.2.20])
 D_CFLAGS=$D_CFLAGS" $PNG_CFLAGS"
 FS2_LIBS=$FS2_LIBS" $PNG_LIBS"
 
+dnl freetype2
+PKG_CHECK_MODULES([FREETYPE2], [freetype2 >= 9.22.3])
+D_CFLAGS=$D_CFLAGS" $FREETYPE2_CFLAGS"
+FS2_LIBS=$FS2_LIBS" $FREETYPE2_LIBS"
+
+dnl ftgl
+PKG_CHECK_MODULES([FTGL], [ftgl >= 2.1.2])
+D_CFLAGS=$D_CFLAGS" $FTGL_CFLAGS"
+FS2_LIBS=$FS2_LIBS" $FTGL_LIBS"
+
 dnl LUA
 ## Checking for lua.pc and if that fails lua5.1.pc
 PKG_CHECK_MODULES(


[attachment deleted by a ninja]
Title: Re: TrueType font rendering
Post by: m!m on April 07, 2012, 06:12:47 am
Thank you very much, I updated the link to the patch in the first post with your changes and it also includes updated Visual Studio 2011 project files.
Title: Re: TrueType font rendering
Post by: Axem on April 08, 2012, 03:43:20 pm
The E put this patch into the experimental BP builds we use, and I spotted some odd behavior with some of the hud gauges.

(http://lazymodders.fsmods.net/axemart/Halping/fonts.png)

It looks like something is happening to hud gauges that are part of the "middle" of larger ones. Any idea whats going on?
Title: Re: TrueType font rendering
Post by: Swifty on April 08, 2012, 06:08:32 pm
The true type rendering library isn't properly resetting it's OpenGL states. It's is making the quads that are being rendered after text have no textures and/or the proper color.
Title: Re: TrueType font rendering
Post by: m!m on April 14, 2012, 05:32:33 am
I can't reproduce this on my end but Swiftys explanation would explain the effect pretty well but I really can't see what the library or my integration could do wrong but after all I don't know much about how OpenGL works... :nervous:
Title: Re: TrueType font rendering
Post by: mjn.mixael on September 02, 2013, 03:23:50 pm
we can haz another serious look at this now that 3.7 is out?
Title: Re: TrueType font rendering
Post by: m!m on September 02, 2013, 03:45:04 pm
:sigh: Merging a patch this old is going to be a pain...
Oh well, it needs to be done...
Title: Re: TrueType font rendering
Post by: m!m on September 04, 2013, 06:23:17 am
Ok, first version of the patch is available here: https://github.com/asarium/fs2open.github.com/tree/trueType (https://github.com/asarium/fs2open.github.com/tree/trueType)
Still has some issues but I think it should work more or less.
Title: Re: TrueType font rendering
Post by: m!m on December 08, 2013, 06:57:49 am
I finally got the special characters to work reasonably well and also fixed some more drawing issues, test builds can be downloaded here: http://www.mediafire.com/download/xas57w7i6347ys1/FSO%203.7.1%20TTF.7z (http://www.mediafire.com/download/xas57w7i6347ys1/FSO%203.7.1%20TTF.7z)
Please note that the wingman status is not drawn correctly at this moment but I wanted to release these builds so people can test if the special characters are drawn correctly for them.
Title: Re: TrueType font rendering
Post by: m!m on April 21, 2014, 08:33:57 am
The link in the first post has been updated. This fixes the wingman status not drawn correctly bug.
I have also added a link to a small example mod showing how to get your fonts into the game.
Title: Re: TrueType font rendering
Post by: m!m on April 25, 2014, 10:18:05 am
New builds are available: http://www.mediafire.com/download/5t4h394nva3uk97/TTFBuilds.7z
This build contains a very important feature which is the ability to use UTF-8 encoded strings to render text (it allows to render characters like ä or ß which wasn't possible before).
As FreeSpace uses the old fonts for more than just drawing text I needed to fix those cases to use other sources. It worked for all but one instance which was weapon selection indicator.
I added a graphic for that which is currently not included in the binary but I will find a way to do that (I'd also appreciate if someone could come up with a better image as my image editing skills are non-existant). This also allows to customize that graphic for your weapons gauge which is also nice.
Title: Re: TrueType font rendering
Post by: Yarn on August 20, 2014, 01:27:31 pm
I can't seem to get your build to work. The opening cutscene plays fine, but immediately after that, I get the attached error message. (An fs2_open.log file is also attached.)

I'm hoping to have this fixed because I want to see how well the build handles German, French, and Polish.

[attachment kidnapped by pirates]
Title: Re: TrueType font rendering
Post by: m!m on August 20, 2014, 01:49:12 pm
I kind of expected that as the build probably don't handle the the other characters well. What data do I need to reproduce this?
Title: Re: TrueType font rendering
Post by: Yarn on August 20, 2014, 05:15:20 pm
I was using your Font Test mod with the English version--nothing from the international versions was used. In fact, I didn't realize that the language was still set to German. (I'm currently testing the SVN version of FSPort in German.) Setting it back to English or playing without your mod "fixed" the problem.

If you want the data from the German and Polish versions of the game (a true French version apparently doesn't exist), I have links to it at the end of this post:
http://www.hard-light.net/forums/index.php?topic=85492.msg1709621#msg1709621 (http://www.hard-light.net/forums/index.php?topic=85492.msg1709621#msg1709621)

And if you want to see exactly what is in each font file, I've got dumps of them here:
https://dl.dropboxusercontent.com/u/89353583/FreeSpace/fs_font_chars.zip (https://dl.dropboxusercontent.com/u/89353583/FreeSpace/fs_font_chars.zip)

I haven't looked through your code yet, so I don't know what might be causing the problem.

I should say this, though: For all languages other than Polish, FreeSpace expects mission, campaign, and table files to be encoded in Windows-1252 (http://en.wikipedia.org/wiki/Windows-1252); while loading those files, the game converts them to CP437 (http://en.wikipedia.org/wiki/Cp437) to match the fonts. (Technically, fiction viewer files should be in that list, but last I checked, no remapping took place there.) If the language is set to Polish, however, the files are supposed to be encoded in Windows-1250 (http://en.wikipedia.org/wiki/Windows-1250), and no code-page conversion occurs. In all cases, though, the letter ß is converted to ss.

(And yes, Ż looks like Ƶ in the Polish font; from what I can tell, this is just a glyph variant in that language.)

If you have any further questions about FreeSpace localization or character sets in general, just ask me; I know quite a bit about those things, so I should be able to answer your questions.
Title: Re: TrueType font rendering
Post by: Yarn on May 02, 2015, 02:19:14 am
Can you look into syncing your TrueType branch with the current trunk? Lots of changes to the localization code have been made since you last did so.
Title: Re: TrueType font rendering
Post by: m!m on May 02, 2015, 03:19:24 am
I will sync the branch as soon as possible.
Please be aware that I will change the rendering backend at some point as the library I am currently using only supports OpenGL 1 which may change how some things work.

EDIT: Branch has been updated.
Title: Re: TrueType font rendering
Post by: Yarn on May 02, 2015, 03:43:04 pm
I tried compiling your branch using Microsoft Visual Studio Community 2013. However, I seem to be unable to do so sucessfully. The project files for the libjpeg, liblua, libpng, and zlib libraries are all missing, and nothing in the Fred2 and Freespace2 folders can be opened (probably because you moved those folders out of the code folder). I'm also getting 339 errors, most of which are caused by a file called "compiler.h" being missing. These issues are preventing me from compiling your branch.
Title: Re: TrueType font rendering
Post by: m!m on May 02, 2015, 03:48:23 pm
:banghead: Those project files aren't supposed to be there. You'll need to use CMake (http://www.cmake.org/) to generate the project files.
Title: Re: TrueType font rendering
Post by: Yarn on May 02, 2015, 04:52:50 pm
I had a feeling I'd need CMake, considering the descriptions of some recent commits. Using it allowed me to compile.

I found a serious bug, though. If black bars are added to the menus to preserve the 4:3 ratio, then TrueType (but not VF) fonts are horribly smeared. I've attached a screenshot of what this looks like at 1034x768 resolution, just ten pixels wider than the standard 1024x768. At wider resolutions, the problem is even worse, making text totally unreadable. This problem doesn't occur at 4:3 resolutions or when the -stretch_menu flag is enabled.

[attachment deleted by nobody]
Title: Re: TrueType font rendering
Post by: m!m on May 02, 2015, 04:57:32 pm
I kind of expected such issues as the current TTF rendering doesn't account for the menu resizing. I'll try to fix this ASAP.
Title: Re: TrueType font rendering
Post by: Yarn on May 02, 2015, 05:02:39 pm
I found the problem already, actually: in line 596 of opengldraw.cpp, the pointers to scale_x and scale_y need to be passed as the 3rd and 4th arguments to prevent the offsets from being added.
Title: Re: TrueType font rendering
Post by: m!m on May 03, 2015, 05:10:15 am
Thanks for your help. The current version should work again (there was also an issue where text would be drawn with the old font rendering system).
Title: Re: TrueType font rendering
Post by: m!m on May 09, 2015, 11:28:04 am
New builds have been uploaded, now the OpenGL backend uses nanovg (https://github.com/memononen/nanovg) to render text which results in much improved font rendering but it doesn't support as many features as FTGL.
Title: Re: TrueType font rendering
Post by: Yarn on May 09, 2015, 02:28:09 pm
I seem to be unable to compile your new branch. Whenever I try to do so, I get 19 compiler errors like this:

Code: [Select]
Description: Attempt to include auto-generated header after including gl.h (C:\Games\FreeSpace2\fs2_open_ttf-nvg\code\cutscene\mveplayer.cpp)
File: C:\Games\FreeSpace2\fs2_open_ttf-nvg\code\graphics\gl\gl_2_1.h
Line: 8

The CPP file in the description is different in each error, but other other than that, almost all the errors are the same.
Title: Re: TrueType font rendering
Post by: m!m on May 09, 2015, 02:36:09 pm
Try building the "clean_cotire" target. If that doesn't work disable the CMake option COTIRE_ENABLE, configure and generate the project files again and try building.
Title: Re: TrueType font rendering
Post by: Yarn on May 09, 2015, 03:31:01 pm
Building "clean_cotire" first didn't help, so I disabled COTIRE_ENABLE. That worked.

When I tried the resulting build, however, I noticed a serious problem that doesn't happen in your test build: At certain areas, certain graphics would just be rendered as solid blocks. Exactly when and where it happens seems to be random in a weird way (it's a bit hard to explain), but it seems to mostly affect special characters within TrueType text, briefing icons, and HUD graphics. An example image of the HUD is attached.

I also noticed a number of new bugs that do occur in your test build in conjunction with your new test mod:

[attachment deleted by nobody]
Title: Re: TrueType font rendering
Post by: m!m on May 09, 2015, 03:46:56 pm
I forgot to push the latest changes to the Github branch, pulling the changes and recompiling should fix a few of your reported issues.

  • Lowercase letters are displayed a few pixels too high.
I don't encounter this issue, can you post a screenshot?

  • There's some graphical weirdness going on whenever a pop-up dialog is displayed. To see what I mean, go to the mission simulator in the Tech Room and notice how the screen looks while the missions are being scanned.
I have encountered this before but I have no idea why it happens.

  • In the first command briefing stage of "Surrender, Belisarius!", just below the "This is Admiral Petrarch" line, there are two blank lines instead of just one. That particular line has a trailing space character, and I think it's being placed on its own line. It looks like you'll have to strip trailing whitespace when rendering each line of text to prevent this problem.
This is an issue with the mission assets that should not be fixed by the code. The font size would need to be adjusted to make sure the text wraps correctly.

  • VF font rendering is completely broken when TrueType fonts are not in use, with each line being rendered with a single square. (This seems to happen only in your build.)
Should be fixed with the newest changes.

I'll compile and upload new builds.

EDIT: Link in first post updated.
Title: Re: TrueType font rendering
Post by: Yarn on May 09, 2015, 04:47:04 pm
Compiling with the new changes appears to have fixed my problem with images not rendering.

  • Lowercase letters are displayed a few pixels too high.
I don't encounter this issue, can you post a screenshot?
Yes--screenshot is attached.

EDIT: This appears to be caused by a rounding error. If I increase the font size, lowercase letters are no longer aligned with the top of capital letters, but they're still usually rendered one pixel too high.

  • In the first command briefing stage of "Surrender, Belisarius!", just below the "This is Admiral Petrarch" line, there are two blank lines instead of just one. That particular line has a trailing space character, and I think it's being placed on its own line. It looks like you'll have to strip trailing whitespace when rendering each line of text to prevent this problem.
This is an issue with the mission assets that should not be fixed by the code. The font size would need to be adjusted to make sure the text wraps correctly.
I added an "a" to the beginning of that line, tried the mission in retail and 3.7.2, and got the same effect. So, it looks like this isn't something that you need to worry about in your code.

  • VF font rendering is completely broken when TrueType fonts are not in use, with each line being rendered with a single square. (This seems to happen only in your build.)
Should be fixed with the newest changes.
Yep, your newest build fixed this!

[attachment deleted by nobody]
Title: Re: TrueType font rendering
Post by: Yarn on May 09, 2015, 05:06:12 pm
I found a typo: In line 305 of font.cpp:
Code: [Select]
Error(LOCATION, "At least three fonts have to be loaded by only %d valid entries were found!", FontManager::numberOfFonts());..."by" should be "but".
Title: Re: TrueType font rendering
Post by: m!m on May 10, 2015, 05:25:07 am
I don't encounter this issue, can you post a screenshot?
Yes--screenshot is attached.

EDIT: This appears to be caused by a rounding error. If I increase the font size, lowercase letters are no longer aligned with the top of capital letters, but they're still usually rendered one pixel too high.
I can reproduce your issue now and I'll look into it. Rendering should be done using floating point numbers so I don't know why it snaps to the next pixel.

EDIT: The bug should be fixed now.

I found a typo: In line 305 of font.cpp:
Code: [Select]
Error(LOCATION, "At least three fonts have to be loaded by only %d valid entries were found!", FontManager::numberOfFonts());..."by" should be "but".
Thanks, I fixed the typo.
Title: Re: TrueType font rendering
Post by: Yarn on May 11, 2015, 09:09:24 pm
It looks like your code is introducing artifacts to VF (but not TrueType) font scaling. Example image at 1200x900 resolution is attached.

[attachment deleted by nobody]
Title: Re: TrueType font rendering
Post by: m!m on May 12, 2015, 02:58:02 am
I noticed that as well but couldn't track it down. My best guess is that I changed the OpenGL state somewhere without accounting for it in the rest of the code. I'll try to track it down but it might take a while...
Title: Re: TrueType font rendering
Post by: m!m on July 19, 2015, 01:04:42 pm
I updated the test builds which should now be up to date which also includes the deferred lightning changes.
Something I forgot to mention previously is that TTF support now requires shader support which means that the minimum version of OpenGL required by these builds is 2.1.

I also found the issue causing the drawing artifacts (the bug was fixed in master but I overwrote it when I merged master into my branch).
Title: Re: TrueType font rendering
Post by: Yarn on July 19, 2015, 09:44:20 pm
I noticed a bug with TrueType rendering a while ago but neglected to report it until now (and yes, it also happens in your new builds):

If the screen resolution is greater than 1024x768 (more accurately, if a VF font would be scaled at the current resolution), some of the text looks a bit blurred. The attached screenshot demonstrates this issue--notice how some of the lines in the Pilot Stats section are slightly blurred, while the others aren't (or at least not as much).

The problem is most likely not caused by rendering at too low a resolution and then scaling up, because TrueType text looks crisp at extreme resolutions. Rather, it's probably caused by rendering at non-integer coordinates. (If I'm not mistaken, you switched from integer to floating point for font rendering.) If that's the case, then perhaps the solution is to convert the font coordinates to integers just before the actual rendering. You can use the fl2ir macro (located in floating.h) to round the numbers and hopefully avoid reintroducing the first bulletted bug in this post (http://www.hard-light.net/forums/index.php?topic=79028.msg1785276#msg1785276).


The same attached screenshot demonstrates another problem that I noticed just now: TrueType fonts aren't being right-aligned properly. In the Pilot Stats section of the screenshot, the lines should be aligned such that all the semicolons line up, but they're not. Right-alignment works fine with VF fonts, and it also works fine with TrueType fonts at 1024x768 resolution, so this is another scaling-related problem. (I suggest tackling the first problem in this post before trying this one.)

[attachment deleted by nobody]
Title: Re: TrueType font rendering
Post by: m!m on July 20, 2015, 12:31:31 pm
There is definitely something wrong with how the size of a string is determined. The image below shows how long the engine beliefs the string to be:

(http://i.imgur.com/BNxTFET.png)

The lines are correctly aligned but the drawn text doesn't match the length of the respective line. It looks like the scaling of the text isn't consistent between determining the string size and actually drawing the text (which also explains why it's fine at 1024x768).

The blurring issue is not as obvious to me (maybe I'm just used to how the old fonts were always blurred...). I'll try to fix the other scaling issue which may also fix this issue...
Title: Re: TrueType font rendering
Post by: Cyborg17 on July 20, 2015, 01:24:26 pm
The blurring can be hard to see.  At first I thought it wasn't there.  I had to move my screen to see it correctly.
Title: Re: TrueType font rendering
Post by: Yarn on July 20, 2015, 01:41:42 pm
You need to view the image at full size without scaling to see the blurring well. (In Firefox, this can be done by right-clicking the image, clicking "View Image," and clicking the image to zoom in if necessary. In other browsers, this is either done differently or not even possible.)

In-game, the problem may be less apparent at higher resolutions. I suggest using running in windowed mode at a resolution that's not much greater than 1024x768. (1600x900 should be a good resolution for testing this; it's the same one that I use.)

But yes, even if you follow this advice, the blurring can be hard to notice. Still, the problem should be fixed.
Title: Re: TrueType font rendering
Post by: Yarn on July 20, 2015, 03:12:58 pm
I'm once again unable to compile your code. These are the errors that I get:

Code: [Select]
error C2280: 'std::unique_ptr<ubyte [],std::default_delete<_Ty>> &std::unique_ptr<_Ty,std::default_delete<_Ty>>::operator =(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function

Location: C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\code\graphics\software\FontManager.cpp

Line: 326

Code: [Select]
error LNK1181: cannot open input file '..\bin\Debug\code_d.lib'

Location: C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\projects\MSVC_2013\freespace2\LINK

I'm using CMake 3.2.3, by the way. (And yes, I did make sure that COTIRE_ENABLE is disabled.)
Title: Re: TrueType font rendering
Post by: m!m on July 21, 2015, 04:15:19 am
What Visual Studio version are you using? That error message looks odd but I changed all usages of operator= to use std::swap which should hopefully work better.

I have gone through all of the code again but couldn't find anything that would explain the scaling issues, I'll keep looking...

EDIT: I found the cause of the alignment issue but I am still searching for a good solution.
Title: Re: TrueType font rendering
Post by: Yarn on July 21, 2015, 12:48:20 pm
I'm using Visual Studio Community 2013 Update 4. I know that VS 2015 has been released, but I'm waiting for a non-RC version of the 2015 MFC library to be available before upgrading (unless I need to upgrade to compile your code, in which case I can do that now).
Title: Re: TrueType font rendering
Post by: m!m on July 21, 2015, 12:51:29 pm
VS 2013 should be more than sufficient. Can you try compiling the newest version? I changed some things that may have fixed that issue.
Title: Re: TrueType font rendering
Post by: Yarn on July 21, 2015, 01:06:50 pm
Nope, didn't help. I should say, though, that I also get over 300 warnings both before and after the changes that you just made. I'll have them posted later today.

What compiler do you use? And what happens if you clear your CMake cache, build a new project, and then try to compile?
Title: Re: TrueType font rendering
Post by: m!m on July 21, 2015, 01:12:47 pm
I am using VS 2015 RC.
Clearing the CMake cache or rebuilding my project will not help as the issue is clearly one that would happen all the time. GCC and Clang are also happy with the code so it's likely that VS 2013 is doing something weird.
Where are those warnings generated? There are some in the thrird-party libraries but those shouldn't matter. I though I fixed all other warnings that originated in my code.
Title: Re: TrueType font rendering
Post by: Yarn on July 21, 2015, 01:33:06 pm
Clearing the CMake cache or rebuilding my project will not help as the issue is clearly one that would happen all the time. GCC and Clang are also happy with the code so it's likely that VS 2013 is doing something weird.
I was actually asking you to do that to see whether the problem would happen to you. This is mainly to check whether the problem occurs only with newly and cleanly generated project files. (And I forgot to include the step of deleting or moving the project files first; that should definitely be done if you try this.)

Where are those warnings generated? There are some in the thrird-party libraries but those shouldn't matter. I though I fixed all other warnings that originated in my code.
Most, but not all, of them do appear to come from third-party libraries.

The entire warning log (which I did say would be posted later today) is below. The numbers at the end of each section are line numbers. For the sake of completeness, I also included the two errors.

Code: [Select]
Warning
1
warning C4131: 'compress2' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\compress.c
23

Warning
2
warning C4131: 'inflateBackInit_' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
29

Warning
3
warning C4131: 'inflate_table' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inftrees.c
33

Warning
4
warning C4131: 'adler32' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\adler32.c
66

Warning
5
warning C4131: 'inflateResetKeep' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
105

Warning
6
warning C4131: 'deflateInit_' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
202

Warning
7
warning C4131: 'adler32_combine_' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\adler32.c
137

Warning
8
warning C4131: 'crc32' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\crc32.c
205

Warning
9
warning C4131: 'adler32_combine' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\adler32.c
166

Warning
10
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\crc32.c
217

Warning
11
warning C4131: 'inflate_fast' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inffast.c
68

Warning
12
warning C4131: 'crc32_little' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\crc32.c
248

Warning
13
warning C4131: 'adler32_combine64' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\adler32.c
174

Warning
14
warning C4131: 'crc32_big' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\crc32.c
288

Warning
15
warning C4131: 'gf2_matrix_times' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\crc32.c
328

Warning
16
warning C4131: 'gf2_matrix_square' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\crc32.c
345

Warning
17
warning C4131: 'crc32_combine_' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\crc32.c
356

Warning
18
warning C4131: 'deflateInit2_' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
215

Warning
19
warning C4131: 'crc32_combine' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\crc32.c
412

Warning
20
warning C4131: 'crc32_combine64' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\crc32.c
420

Warning
21
warning C4131: 'fixedtables' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
83

Warning
22
warning C4131: 'compress' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\compress.c
63

Warning
23
warning C4131: 'inflateBack' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
251

Warning
24
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
295

Warning
25
warning C4131: 'deflateSetDictionary' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
324

Warning
26
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
299

Warning
27
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
301

Warning
28
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
323

Warning
29
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
328

Warning
30
warning C4131: 'deflateResetKeep' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
393

Warning
31
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
329

Warning
32
warning C4131: 'deflateReset' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
428

Warning
33
warning C4131: 'deflateSetHeader' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
440

Warning
34
warning C4131: 'compressBound' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\compress.c
76

Warning
35
warning C4131: 'deflatePending' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
451

Warning
36
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
338

Warning
37
warning C4131: 'deflatePrime' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
465

Warning
38
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
343

Warning
39
warning C4131: 'deflateParams' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
491

Warning
40
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
344

Warning
41
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
360

Warning
42
warning C4131: 'deflateTune' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
532

Warning
43
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
362

Warning
44
warning C4131: 'deflateBound' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
567

Warning
45
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
364

Warning
46
warning C4131: 'putShortMSB' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
629

Warning
47
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
366

Warning
48
warning C4131: 'flush_pending' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
643

Warning
49
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
379

Warning
50
warning C4131: 'inflateReset' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
130

Warning
51
warning C4131: 'deflate' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
666

Warning
52
warning C4131: 'inflateReset2' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
143

Warning
53
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
381

Warning
54
warning C4131: 'inflateInit2_' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
181

Warning
55
warning C4244: '=' : conversion from 'int' to 'Bytef', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
811

Warning
56
warning C4131: 'inflateInit_' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
223

Warning
57
warning C4244: '=' : conversion from 'int' to 'Bytef', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
842

Warning
58
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
403

Warning
59
warning C4131: 'inflatePrime' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
231

Warning
60
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
406

Warning
61
warning C4131: 'fixedtables' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
262

Warning
62
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
411

Warning
63
warning C4131: 'deflateEnd' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
980

Warning
64
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
412

Warning
65
warning C4131: 'deflateCopy' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
1015

Warning
66
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
420

Warning
67
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
423

Warning
68
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
424

Warning
69
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
427

Warning
70
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
430

Warning
71
warning C4131: 'read_buf' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
1077

Warning
72
warning C4131: 'updatewindow' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
380

Warning
73
warning C4131: 'lm_init' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
1107

Warning
74
warning C4131: 'inflate' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
606

Warning
75
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
634

Warning
76
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
431

Warning
77
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
645

Warning
78
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
434

Warning
79
warning C4131: 'longest_match' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
1149

Warning
80
warning C4131: 'fill_window' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
1391

Warning
81
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
1404

Warning
82
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
484

Warning
83
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
649

Warning
84
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
650

Warning
85
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
488

Warning
86
warning C4131: 'deflate_stored' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
1565

Warning
87
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
496

Warning
88
warning C4131: 'deflate_fast' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
1629

Warning
89
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
504

Warning
90
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
671

Warning
91
warning C4244: 'initializing' : conversion from 'uInt' to 'uch', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
1672

Warning
92
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
506

Warning
93
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
684

Warning
94
warning C4244: 'initializing' : conversion from 'uInt' to 'ush', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
1672

Warning
95
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
508

Warning
96
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
688

Warning
97
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
516

Warning
98
warning C4131: 'deflate_slow' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
1731

Warning
99
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
540

Warning
100
warning C4244: 'initializing' : conversion from 'uInt' to 'uch', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
1797

Warning
101
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
702

Warning
102
warning C4244: 'initializing' : conversion from 'uInt' to 'ush', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
1797

Warning
103
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
703

Warning
104
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
706

Warning
105
warning C4131: 'deflate_rle' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
1862

Warning
106
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
542

Warning
107
warning C4244: 'initializing' : conversion from 'uInt' to 'uch', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
1906

Warning
108
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
550

Warning
109
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
709

Warning
110
warning C4131: 'deflate_huff' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\deflate.c
1935

Warning
111
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
710

Warning
112
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
558

Warning
113
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
713

Warning
114
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
560

Warning
115
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
718

Warning
116
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
562

Warning
117
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
719

Warning
118
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
573

Warning
119
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
723

Warning
120
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
727

Warning
121
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
575

Warning
122
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
728

Warning
123
warning C4244: '=' : conversion from 'unsigned int' to 'Bytef', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
764

Warning
124
warning C4244: '=' : conversion from 'unsigned int' to 'Bytef', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
785

Warning
125
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
798

Warning
126
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
804

Warning
127
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
815

Warning
128
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
817

Warning
129
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
821

Warning
130
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
830

Warning
131
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
834

Warning
132
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
836

Warning
133
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
849

Warning
134
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
862

Warning
135
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
865

Warning
136
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
866

Warning
137
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
587

Warning
138
warning C4131: 'inflateBackEnd' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\infback.c
632

Warning
139
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
875

Warning
140
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
898

Warning
141
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
900

Warning
142
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
902

Warning
143
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
904

Warning
144
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
917

Warning
145
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
919

Warning
146
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
941

Warning
147
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
944

Warning
148
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
949

Warning
149
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
950

Warning
150
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
958

Warning
151
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
961

Warning
152
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
962

Warning
153
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
965

Warning
154
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
968

Warning
155
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
969

Warning
156
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
972

Warning
157
warning C4100: 'input_buf' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jctrans.c
272

Warning
158
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdapimin.c
153

Warning
159
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1023

Warning
160
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1025

Warning
161
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1034

Warning
162
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1042

Warning
163
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1044

Warning
164
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1047

Warning
165
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1072

Warning
166
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1074

Warning
167
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1084

Warning
168
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1092

Warning
169
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1094

Warning
170
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1097

Warning
171
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1109

Warning
172
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1111

Warning
173
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1176

Warning
174
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1193

Warning
175
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1200

Warning
176
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1206

Warning
177
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1231

Warning
178
warning C4131: 'inflateEnd' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1255

Warning
179
warning C4131: 'inflateGetDictionary' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1269

Warning
180
warning C4131: 'inflateSetDictionary' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1292

Warning
181
warning C4131: 'inflateGetHeader' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1327

Warning
182
warning C4131: 'syncsearch' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1355

Warning
183
warning C4131: 'inflateSync' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1378

Warning
184
warning C4131: 'uncompress' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\uncompr.c
25

Warning
185
warning C4131: 'inflateSyncPoint' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1429

Warning
186
warning C4131: 'inflateCopy' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1439

Warning
187
warning C4131: 'inflateUndermine' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1486

Warning
188
warning C4131: 'inflateMark' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\inflate.c
1503

Warning
189
warning C4131: '_tr_init' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
382

Warning
190
warning C4131: 'init_block' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
410

Warning
191
warning C4131: 'pqdownheap' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
454

Warning
192
warning C4131: 'gen_bitlen' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
489

Warning
193
warning C4131: 'gen_codes' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
576

Warning
194
warning C4244: '=' : conversion from 'unsigned int' to 'ush', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
602

Warning
195
warning C4131: 'build_tree' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
618

Warning
196
warning C4131: 'scan_tree' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
706

Warning
197
warning C4244: '+=' : conversion from 'int' to 'ush', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
726

Warning
198
warning C4131: 'send_tree' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
751

Warning
199
warning C4131: 'build_bl_tree' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
802

Warning
200
warning C4131: 'send_all_trees' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
837

Warning
201
warning C4131: 'zError' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\zutil.c
137

Warning
202
warning C4131: '_tr_stored_block' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
866

Warning
203
warning C4131: 'zcalloc' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\zutil.c
305

Warning
204
warning C4131: '_tr_flush_bits' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
883

Warning
205
warning C4131: '_tr_align' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
893

Warning
206
warning C4131: '_tr_flush_block' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
908

Warning
207
warning C4131: 'zcfree' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\zutil.c
315

Warning
208
warning C4131: '_tr_tally' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
1011

Warning
209
warning C4131: 'compress_block' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
1061

Warning
210
warning C4131: 'detect_data_type' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
1121

Warning
211
warning C4131: 'bi_reverse' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
1155

Warning
212
warning C4131: 'bi_flush' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
1170

Warning
213
warning C4131: 'bi_windup' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
1187

Warning
214
warning C4131: 'copy_block' : uses old-style declarator
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\zlib\trees.c
1206

Warning
215
warning C4100: 'cinfo' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdatasrc.c
57

Warning
216
warning C4100: 'cinfo' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdatasrc.c
196

Warning
217
warning C4244: '+=' : conversion from 'int' to 'JCOEF', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdarith.c
472

Warning
218
warning C4244: '+=' : conversion from 'int' to 'JCOEF', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdarith.c
474

Warning
219
warning C4244: '=' : conversion from 'int' to 'JCOEF', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdarith.c
480

Warning
220
warning C4244: '=' : conversion from 'int' to 'JCOEF', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdarith.c
482

Warning
221
warning C4100: 'wenvp' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libsdl\src\SDL_windows_main.c
142

Warning
222
warning C4100: 'sw' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libsdl\src\SDL_windows_main.c
163

Warning
223
warning C4100: 'szCmdLine' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libsdl\src\SDL_windows_main.c
163

Warning
224
warning C4100: 'hPrev' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libsdl\src\SDL_windows_main.c
163

Warning
225
warning C4100: 'hInst' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libsdl\src\SDL_windows_main.c
163

Warning
226
warning C4100: 'cinfo' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdcolor.c
293

Warning
227
warning C4244: '+=' : conversion from 'int' to 'JCOEF', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdhuff.c
989

Warning
228
warning C4244: '+=' : conversion from 'int' to 'JCOEF', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdhuff.c
991

Warning
229
warning C4244: '+=' : conversion from 'int' to 'JCOEF', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdhuff.c
1023

Warning
230
warning C4244: '+=' : conversion from 'int' to 'JCOEF', possible loss of data
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdhuff.c
1025

Warning
231
warning C4100: 'cinfo' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdcoefct.c
228

Warning
232
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
251

Warning
233
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
253

Warning
234
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
254

Warning
235
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
255

Warning
236
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
256

Warning
237
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
262

Warning
238
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
285

Warning
239
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
286

Warning
240
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
289

Warning
241
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
293

Warning
242
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
315

Warning
243
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
317

Warning
244
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
331

Warning
245
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
332

Warning
246
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
349

Warning
247
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
353

Warning
248
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
355

Warning
249
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
357

Warning
250
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
362

Warning
251
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
385

Warning
252
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
389

Warning
253
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
390

Warning
254
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
434

Warning
255
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
438

Warning
256
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
445

Warning
257
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
453

Warning
258
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
456

Warning
259
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
465

Warning
260
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
505

Warning
261
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
510

Warning
262
warning C4100: 'in_row_groups_avail' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdsample.c
92

Warning
263
warning C4100: 'compptr' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdsample.c
158

Warning
264
warning C4100: 'cinfo' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdsample.c
158

Warning
265
warning C4100: 'input_data' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdsample.c
172

Warning
266
warning C4100: 'compptr' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdsample.c
171

Warning
267
warning C4100: 'cinfo' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdsample.c
171

Warning
268
warning C4100: 'compptr' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdsample.c
234

Warning
269
warning C4100: 'compptr' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdsample.c
262

Warning
270
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
555

Warning
271
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
557

Warning
272
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
568

Warning
273
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
592

Warning
274
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
597

Warning
275
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
655

Warning
276
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
717

Warning
277
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
736

Warning
278
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
747

Warning
279
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
788

Warning
280
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
888

Warning
281
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
917

Warning
282
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
926

Warning
283
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
934

Warning
284
warning C4100: 'in_row_groups_avail' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmerge.c
146

Warning
285
warning C4100: 'out_rows_avail' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmerge.c
197

Warning
286
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
969

Warning
287
warning C4100: 'in_row_groups_avail' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmerge.c
195

Warning
288
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdmarker.c
970

Warning
289
warning C4100: 'out_rows_avail' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdpostct.c
162

Warning
290
warning C4100: 'output_buf' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdpostct.c
161

Warning
291
warning C4100: 'in_row_groups_avail' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdpostct.c
204

Warning
292
warning C4100: 'in_row_group_ctr' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdpostct.c
203

Warning
293
warning C4100: 'input_buf' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jdpostct.c
203

Warning
294
warning C4100: 'cinfo' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jmemnobs.c
35

Warning
295
warning C4100: 'sizeofobject' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jmemnobs.c
41

Warning
296
warning C4100: 'cinfo' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jmemnobs.c
41

Warning
297
warning C4100: 'cinfo' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jmemnobs.c
55

Warning
298
warning C4100: 'sizeofobject' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jmemnobs.c
61

Warning
299
warning C4100: 'cinfo' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jmemnobs.c
61

Warning
300
warning C4100: 'already_allocated' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jmemnobs.c
74

Warning
301
warning C4100: 'min_bytes_needed' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jmemnobs.c
73

Warning
302
warning C4100: 'cinfo' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jmemnobs.c
73

Warning
303
warning C4100: 'total_bytes_needed' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jmemnobs.c
88

Warning
304
warning C4100: 'info' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jmemnobs.c
87

Warning
305
warning C4100: 'cinfo' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jmemnobs.c
100

Warning
306
warning C4100: 'cinfo' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jmemnobs.c
106

Warning
307
warning C4100: 'ci' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jquant1.c
245

Warning
308
warning C4100: 'cinfo' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jquant1.c
245

Warning
309
warning C4100: 'ci' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jquant1.c
259

Warning
310
warning C4100: 'cinfo' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jquant1.c
259

Warning
311
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jquant1.c
287

Warning
312
warning C4100: 'output_buf' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jquant2.c
225

Warning
313
warning C4127: conditional expression is constant
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jmemmgr.c
1044

Warning
314
warning C4100: 'is_pre_scan' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jquant1.c
741

Warning
315
warning C4100: 'cinfo' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jquant1.c
798

Warning
316
warning C4100: 'cinfo' : unreferenced formal parameter
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\lib\libjpeg\jquant2.c
1156

Warning
317
warning C4018: '<=' : signed/unsigned mismatch
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\code\gamesnd\gamesnd.cpp
765

Warning
318
warning C4244: '=' : conversion from 'int' to 'float', possible loss of data (C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\code\graphics\paths\NVGRenderer.cpp)
c:\games\freespace2\fs2_open\asarium_ttf-nvg\code\graphics\paths\nanovg\nanovg_gl.h
900

Error
319
error C2280: 'std::unique_ptr<ubyte [],std::default_delete<_Ty>> &std::unique_ptr<_Ty,std::default_delete<_Ty>>::operator =(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\code\graphics\software\FontManager.cpp
326

Warning
320
warning C4005: 'HAVE_STDDEF_H' : macro redefinition (C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\code\jpgutils\jpgutils.cpp)
c:\games\freespace2\fs2_open\asarium_ttf-nvg\lib\libsdl\include\SDL_config.h
144

Warning
321
warning C4505: 'accurate_square_root' : unreferenced local function has been removed
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\code\math\fvi.cpp
25

Warning
322
warning C4505: 'rotate_z' : unreferenced local function has been removed
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\code\math\vecmat.cpp
1612

Warning
323
warning C4702: unreachable code
c:\games\freespace2\fs2_open\asarium_ttf-nvg\code\parse\parselo.cpp
698

Error
324
error LNK1181: cannot open input file '..\bin\Debug\code_d.lib'
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\projects\MSVC_2013\freespace2\LINK


Title: Re: TrueType font rendering
Post by: m!m on July 21, 2015, 02:42:38 pm
I tried again with new project files, no change.

The error doesn't make sense though. It may be an issue with TrueTypeFontData, can you post the full error message?

I changed the map insertion to use std::map::insert which should completely circumvent any copy assignment operators.
Title: Re: TrueType font rendering
Post by: Yarn on July 21, 2015, 03:50:30 pm
Your change didn't solve the problem, but it did change the error message a bit.

Here are the full (I think) errors, both before and after the change:

Before:
Code: [Select]
8>C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\code\graphics\software\FontManager.cpp(326): error C2280: 'std::unique_ptr<ubyte [],std::default_delete<_Ty>> &std::unique_ptr<_Ty,std::default_delete<_Ty>>::operator =(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function
8>          with
8>          [
8>              _Ty=ubyte []
8>          ]
8>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\memory(1620) : see declaration of 'std::unique_ptr<ubyte [],std::default_delete<_Ty>>::operator ='
8>          with
8>          [
8>              _Ty=ubyte []
8>          ]
8>          This diagnostic occurred in the compiler generated function 'font::TrueTypeFontData &font::TrueTypeFontData::operator =(const font::TrueTypeFontData &)'

After:
Code: [Select]
8>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocnum(155): error C2280: 'std::unique_ptr<ubyte [],std::default_delete<_Ty>>::unique_ptr(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function
8>          with
8>          [
8>              _Ty=ubyte []
8>          ] (C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\code\graphics\software\FontManager.cpp)
8>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\memory(1618) : see declaration of 'std::unique_ptr<ubyte [],std::default_delete<_Ty>>::unique_ptr'
8>          with
8>          [
8>              _Ty=ubyte []
8>          ]
8>          This diagnostic occurred in the compiler generated function 'font::TrueTypeFontData::TrueTypeFontData(const font::TrueTypeFontData &)'

I also tried deleting my local repository and reimported it from GitHub; no change.
Title: Re: TrueType font rendering
Post by: m!m on July 22, 2015, 05:27:26 am
I expected that it happened in the automatically generated constructor. I have no idea why the function gets referenced but I added custom copy and move constructors and operators which should at least narrow down where this issue happens.
Title: Re: TrueType font rendering
Post by: Yarn on July 22, 2015, 01:11:07 pm
Yep, that fixed it. I'm able to compile and run it now.
Title: Re: TrueType font rendering
Post by: m!m on July 22, 2015, 03:37:05 pm
Great, now I'll just have to find a good solution for that alignment issue and maybe I'll be able to debug that blurring issue at some point...

EDIT: I found a "solution" that reduces the alignment issues but it doesn't completely solve it. I also finally noticed that blurring issue although the documentation of the drawing library claims that all characters are drawn at pixel edges so I'm not sure what's the issue there...
Title: Re: TrueType font rendering
Post by: m!m on July 24, 2015, 10:34:11 am
I think I solved most of the blurring, the glyphs were indeed placed on non-integer coordinates which was not what the documentation promised.

I updated the builds in the first post with the newest version.

EDIT: Below is a picture showing two different methods of rendering the text (please ignore the lines above the text), which one looks better?
(http://i.imgur.com/08qI8rR.png)
Title: Re: TrueType font rendering
Post by: Yarn on July 24, 2015, 05:53:57 pm
I think the one on the right looks better.


And yes, the blurring issue appears to be gone.
Title: Re: TrueType font rendering
Post by: m!m on July 25, 2015, 04:49:50 am
Yeah, that's also my impression.

I may tweak the glyph positioning a bit but I think everything else is pretty much covered. Are there any issues I missed? If not then this is pretty much ready to be merged (although antipodes and CMake need to be merged before this so it might take some time).
Title: Re: TrueType font rendering
Post by: Yarn on July 25, 2015, 02:32:13 pm
There's definitely still work to be done:

I think I know what techniques to use for rendering the monospace 1 and the match-speed icon; the question is whether those techniques are at all possible with NanoVG. I also know which Unicode characters can be used for the other special characters and the accented characters. (The ability to check whether a TrueType font has a particular character will be useful here but not required.) I'll post more on this later.
Title: Re: TrueType font rendering
Post by: m!m on July 25, 2015, 03:41:18 pm
NanoVG has support for UTF-8 encoded Unicode codepoints so that will be no problem.

Full UTF-8 support would be great and I already implemented that in the past but there has to be a lot of special handling to make sure retail FSO isn't affected. Accented characters cause similar issues as NanoVG expects UTF-8 encoded strings but we can't supply those so those would need to be converted when the respective table files are parsed which could cause a lot of other issues.

In my opinion the best solution would be to make modders who use TrueType fonts aware of these limitations and that the behavior may change in the future when proper UTF-8 support is implemented.
Title: Re: TrueType font rendering
Post by: Yarn on July 25, 2015, 07:34:16 pm
OK, so most of those things can wait until Unicode support is implemented. (And you can bet that I'll start that effort shortly after this gets committed to trunk. Just don't expect it to involve simply committing your UTF-8 branch as it is currently; there's still a ton of work to do there, and there's even a possibility that the end result won't use your code at all.)

At least we can look at the monospace 1 and the match-speed icon, which shouldn't require the use of Unicode characters. Before I suggest the full rendering techniques, I want to know whether these are possible:
Title: Re: TrueType font rendering
Post by: m!m on July 26, 2015, 05:55:13 am

Just to clarify, my UTF-8 changes only affected the string rendering and nothing else. It would probably break if you threw accented characters at it...
Title: Re: TrueType font rendering
Post by: Yarn on July 26, 2015, 07:05:54 pm
I'm not exactly sure what you mean, text can be positioned freely so horizontal centering is trivial
As long as you can draw individual characters of a string anywhere you want, that's good.

Here's how I suggest handling the monospace 1 (I hope this is clear enough):
If you attempt this, make sure you take care of every use of hud_num_make_mono! That function is used in lots of places in the HUD code and once in stats.cpp.


Probably isn't possible without changes to NanoVG (it's possible to do that with normal paths but text is special). It's possible to just draw a rectangle and then draw the text with another color above that. It wouldn't be a "hole" but in most cases it would probably work fine.
Is it possible to get the rendered text image before it's rendered to the screen? If so, then you may be able to achieve this effect by inverting the alpha of each pixel of the image (along with maybe performing other operations on it).
Title: Re: TrueType font rendering
Post by: m!m on July 27, 2015, 03:34:46 am
As long as you can draw individual characters of a string anywhere you want, that's good.

Here's how I suggest handling the monospace 1 (I hope this is clear enough):
  • As FSO starts up, for each TrueType font, get the width of each of the digits 0-9, and store the width of the widest digit. Make sure you're storing a different width for each font, not a single width for all of them! This way, you will know how much horizontal space to give each digit when drawing strings that might have a monospace 1.
  • If a string is to use the monospace 1, it should not be passed to hud_num_make_mono, at least not initially. Instead, it should be passed to gr_string as-is along with a new flag indicating that the string should be drawn with monospace digits.
  • In gr_string/gr_opengl_string, if the aforementioned flag is passed, then exactly what to do depends on what kind of font is being used to render the string. If it's a VF font, then pass the string to hud_num_make_mono, and then draw the resulting string as normal. If it's TrueType, then draw each character individually in a space as wide as the width that you got during FSO initialization (and center the character in that space).
If you attempt this, make sure you take care of every use of hud_num_make_mono! That function is used in lots of places in the HUD code and once in stats.cpp.
Honestly, I don't see the point in introducing yet another code path for a feature that is barely noticed. It would be better to just ignore hud_num_make_mono when a TrueType font is set. If a modder wants to have a monospaced font in the HUD then they can just use another font and change the HUD gauges which should use that font.

Is it possible to get the rendered text image before it's rendered to the screen? If so, then you may be able to achieve this effect by inverting the alpha of each pixel of the image (along with maybe performing other operations on it).
It's possible but I don't think it's worth the effort, I think it would be better to either keep using the VF character or to paint the character in black above a rectangle. In most cases that would match how it's drawn currently and it wouldn't cause any performance penalties as the other solution would be drawing it to a framebuffer and then drawing the attached texture to the screen using a special shader.
Title: Re: TrueType font rendering
Post by: Yarn on July 27, 2015, 07:55:18 pm
Honestly, I don't see the point in introducing yet another code path for a feature that is barely noticed. It would be better to just ignore hud_num_make_mono when a TrueType font is set. If a modder wants to have a monospaced font in the HUD then they can just use another font and change the HUD gauges which should use that font.
In that case, your idea should work well enough. At least the BankGothic MT TrueType font appears to use fixed-width digits, so there shouldn't be any problem with that. If there are any good TrueType editors (preferably free ones) that can adjust character widths, modders could use one of those if desired. (And it's probably better to just make hud_num_make_mono do nothing if a TrueType font is given.)

It's possible but I don't think it's worth the effort, I think it would be better to either keep using the VF character or to paint the character in black above a rectangle. In most cases that would match how it's drawn currently and it wouldn't cause any performance penalties as the other solution would be drawing it to a framebuffer and then drawing the attached texture to the screen using a special shader.
I say go ahead with your second idea (drawing a black character). I'm a little skeptical as to whether it will look right if the speed gauge is almost completely transparent (I know, very few players would configure their HUD this way, but still), but I'd still like to see how it will look.

If you implement this by checking whether a character is the match-speed icon, be sure to use compare using unsigned integers. If you don't, then you'll most likely hit the undefined behavior of signed integer overflow.


Just so you know, I will be away from tomorrow until Wednesday of next week, and I won't be able to do any testing during that time. After I return, I'm going to check whether your code works with the German and Polish versions of the game without TrueType fonts; we want them to work first before committing your code.
Title: Re: TrueType font rendering
Post by: m!m on July 28, 2015, 06:11:51 am
I changed hud_num_make_mono to only do something if the font is a Volition font.

The throttle gauge now draws a black 'm' above a rectangle if a true type font is used, it looks reasonably well but a custom HUD should probably use a bold font.
Title: Re: TrueType font rendering
Post by: Yarn on August 09, 2015, 11:42:06 pm
The latest merge from your CMake branch is preventing embedfile.cpp from compiling, at least in Visual Studio 2013. I get 13 errors, all of which are identical to the following except for the line number:
Code: [Select]
C:\Games\FreeSpace2\fs2_open\asarium_ttf-nvg\tools\embedfile\embedfile.cpp(79): error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'const std::string' (or there is no acceptable conversion)

Readding the "#include <string>" line that you removed allows me to compile, as does removing the ".h" from "#include <string.h>".
Title: Re: TrueType font rendering
Post by: m!m on August 10, 2015, 06:32:50 am
I readded the <string> include, that should fix compilation with VS 2013.
Title: Re: TrueType font rendering
Post by: Yarn on August 10, 2015, 09:47:37 pm
All right, I tested the things that I wanted to test so far.

Your fix for the monospaced 1 works well, as I expected. The TrueType match-speed icon also looks good. It does look taller than the VF version (most likely due to the TrueType font having more vertical space), but it can probably be left alone for now.

I also tested your code with the German and Polish data while setting the language in the registry accordingly. German seems to work fine, although I did get a generic "this program has stopped working" error once when loading a mission (and I can't seem to reproduce it). Polish works until I quit the game, at which point I get that generic error. Oddly, if I play in Polish without the Polish data, the game quits fine. I'll do some more testing to determine what exactly is triggering this error.
Title: Re: TrueType font rendering
Post by: m!m on August 11, 2015, 02:34:37 pm
If you build a debug build with Visual Studio and run that you should be able to attach the debugger when the executable crashes. A stacktrace would be very useful to resolve this issue
Title: Re: TrueType font rendering
Post by: Yarn on August 11, 2015, 03:11:01 pm
I've determined that the crash is being triggered by the Polish tstrings.tbl. I don't know yet whether any specific lines are causing it, though.

When I run the debugger, this is the error that I get:
Code: [Select]
Unhandled exception at 0x00B6153E in fs2_open_3_7_3-AVX-DEBUG.exe: 0xC0000005: Access violation reading location 0x04B71532.

And this is the stack trace:
Code: [Select]
fs2_open_3_7_3-AVX-DEBUG.exe!CheckBytes(unsigned char * pb, unsigned char bCheck, unsigned int nSize) Line 1696
fs2_open_3_7_3-AVX-DEBUG.exe!_free_dbg_nolock(void * pUserData, int nBlockUse) Line 1357
fs2_open_3_7_3-AVX-DEBUG.exe!_free_dbg(void * pUserData, int nBlockUse) Line 1265
fs2_open_3_7_3-AVX-DEBUG.exe!_vm_free(void * ptr, char * filename, int line) Line 1221
fs2_open_3_7_3-AVX-DEBUG.exe!lcl_xstr_close() Line 463
[External Code]
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]

EDIT: If you want to try reproducing this yourself, you can get the Polish data files at the bottom of this post: http://www.hard-light.net/forums/index.php?topic=85492.msg1709621#msg1709621 (http://www.hard-light.net/forums/index.php?topic=85492.msg1709621#msg1709621). Make sure you change the game's language to Polish, or else the crash will not occur.
Title: Re: TrueType font rendering
Post by: m!m on August 12, 2015, 04:52:54 am
:mad: I tried reproducing the crash but apparently it is Windows/Visual Studio specific (which is not surprising given the stacktrace).
I also tried running FSO through valgrind (a memory debugging tool) but that also didn't produce any results.

Can you try building and running a build from my 'cmake' branch? I want to know if this issue is specific to the TrueType stuff or if it was introduced with the cmake changes.
Title: Re: TrueType font rendering
Post by: Yarn on August 12, 2015, 10:35:35 pm
The crash indeed happened in the CMake branch. Fortunately, your recent changes seem to have fixed the problem in both the CMake and TrueType branches. I'll do some more testing and see whether I find any more localization-related issues.

I've noticed that the TrueType font in your example mod is rendered a bit too low compared to the default VF font, in both the HUD and the menus, despite the fact that both fonts are the same size. I'm sure this is due to the TrueType font having more space above the letters for accents and such. While the HUD can be modified to better fit the font, the menus cannot. Thus, I think you should add a parameter that adjusts a font's Y offset. This parameter should affect all text rendered with that font as well as all boxes drawn behind it. (If it would make this simpler to implement, you could also allow VF fonts to take this parameter.)
Title: Re: TrueType font rendering
Post by: m!m on August 13, 2015, 04:28:58 am
There is an option to specify a top and bottom offset for fonts to artificially increase the line height. I'll have tot test of this properly handles negative numbers but in theory that should be enough to decrease the line height.

EDIT: It works well but "special" characters (e.g. the copyright symbol) are misplaced. I'll have to figure out a solution for that.
Title: Re: TrueType font rendering
Post by: Yarn on August 18, 2015, 08:11:46 pm
There is an option to specify a top and bottom offset for fonts to artificially increase the line height. I'll have tot test of this properly handles negative numbers but in theory that should be enough to decrease the line height.
Unfortunately, that probably won't be enough. Increasing the line height also increases the height of any boxes drawn behind the text, so simply decreasing the height can result in accents and such being drawn outside the boxes. Also, if the line height is decreased from only the top or bottom, then boxes could extend too far in one direction. (And no, reducing the line height from both the top and bottom isn't good enough either because doing so can cause accents to run into the line above.)
Title: Re: TrueType font rendering
Post by: m!m on August 25, 2015, 04:39:01 pm
Well, accents are the whole reason why the box is too big. If a modder wants a version where the box isn't too big they will have to find a font where accented characters aren't bigger than the normal characters.
Title: Re: TrueType font rendering
Post by: Yarn on August 25, 2015, 05:03:07 pm
I understand that, but I'm trying to say that changing +Top offset and +Bottom offset also affects the height of the box. Thus, setting +Top offset to a negative value and +Bottom offset to a positive value to fix the Y position of the text would also make the boxes off-centered, which wouldn't look good. This is why I think a new parameter should be added that adjusts the Y position of a font as well as any boxes drawn behind that font.
Title: Re: TrueType font rendering
Post by: m!m on August 26, 2015, 04:00:55 am
I though about it some more and I don't think we actually need such an option. The height is a property of the font that has a good reason for being exactly what it is and if the line height of a font should be less then the font needs to change and not the rendering engine.
Title: Re: TrueType font rendering
Post by: Yarn on August 26, 2015, 04:24:30 am
I think you're misunderstanding me. I was actually trying to say that messing with the line height is not a good way to fix the text positioning. I'm not suggesting having an option to reduce the line height; rather, I'm suggesting having a way to move the text up slightly while keeping the line height the same. Achieving this shouldn't require reducing the line height.
Title: Re: TrueType font rendering
Post by: m!m on August 26, 2015, 04:30:38 am
I do understand that but I really dislike the idea of adding an option to fix an issue that should be fixed by the font itself and not the renderer. There are already a lot of fixes to make the code work with retail and I don't want to introduce more code paths for something that is a problem of the font.
Title: Re: TrueType font rendering
Post by: Yarn on August 26, 2015, 12:52:38 pm
So you're saying that there's a way to edit a font to make it be rendered at a slightly higher position without reducing the amount of space given for accents? If so, how can it be done?
Title: Re: TrueType font rendering
Post by: m!m on August 26, 2015, 02:19:04 pm
I have no idea how to edit a TrueType font but having a font where an accented character isn't taller than a capital character should work fine as the maximum line height is the height of a capital letter and not the height of the accented character.
Title: Re: TrueType font rendering
Post by: jr2 on August 26, 2015, 03:19:25 pm
http://fontforge.github.io/en-US/

These folks look decent.
Title: Re: TrueType font rendering
Post by: Yarn on August 26, 2015, 05:35:23 pm
Your belief that "the maximum line height is the height of a capital letter and not the height of the accented character" is incorrect. Why? Because capital letters can take accents too, and accented capital letters are even taller than regular capital letters. Also, accented lowercase letters can be taller than capital letters. Add to that the existence of letters with underhangs (e.g., the lowercase letters g and j), accents below letters (e.g., the French letter Ç), and the possibility of multiple rows of accents (as in Vietnamese), and you can see that a font's line height definitely needs to be greater than the height of a regular capital letter (and most fonts, including BankGothic, take this stuff into account).

While it's technically possible to make accented letters no taller than regular capital letters, it's far from ideal. Sure, the default VF font of the localized versions manages to do this, but only by doing things like squashing the letter or shifting the letter down slightly (made possible by the two extra pixels of space below the letters), so it doesn't look all that great.

If you want to see what all the characters look like, check this out: https://www.dropbox.com/s/3iwoymnmwpg9ydu/fs_font_chars.zip?dl=1 (https://www.dropbox.com/s/3iwoymnmwpg9ydu/fs_font_chars.zip?dl=1). It contains a PNG of every character from every font of every version FS1 and FS2 that I could obtain, with duplicate font files omitted.

tl;dr: The issue at hand isn't something that can properly fixed by modifying the font. Requiring modders to reduce the height of accented characters just to fix the text positioning isn't a good idea because that would make such characters look unnecessarily worse than they should.
Title: Re: TrueType font rendering
Post by: m!m on September 12, 2015, 09:55:42 am
Sorry for the delay, I'm a bit busy right now...

I understand that changing the fonts is far from an ideal solution but all this discussion boils down to the fact that the current interface is just not designed for special characters and changing that is out of the scope of this project.
Should the interface be overhauled at some point those considerations can be used to design a better UI that can be used with all languages.
Title: Re: TrueType font rendering
Post by: Yarn on September 12, 2015, 08:17:28 pm
I've been thinking about this some more. It turns out that this issue isn't really specific to TrueType fonts; it also affects taller VF fonts. Thus, it's probably better after all to fix this issue separately from this project. (And I think I can fix this in a way that doesn't require table edits, at least for text whose Y-positions are hard-coded and cannot be changed.)

With that out of the way, I think this branch is about ready to be merged.
Title: Re: TrueType font rendering
Post by: Bryan See on January 02, 2016, 12:24:31 pm
Yarn, has this branch merged into master of the git branch?
Title: Re: TrueType font rendering
Post by: The E on January 02, 2016, 01:01:06 pm
No.
Title: Re: TrueType font rendering
Post by: m!m on August 02, 2016, 05:19:28 am
After five years, this has finally been merged into master!

The changes will appear in the next nightly build and I'll update the wiki ASAP.

EDIT: Wiki has been updated.
Title: Re: TrueType font rendering
Post by: Bryan See on August 02, 2016, 11:59:34 am
Looking forward to it :)

Anyway, what about the font limits, which is currently set to 5? Will these be bumped to higher numbers or infinite?
Title: Re: TrueType font rendering
Post by: m!m on August 02, 2016, 12:02:59 pm
Quote from: FreeSpace wiki
The number of possible fonts is unlimited.
Title: Re: TrueType font rendering
Post by: Axem on August 02, 2016, 12:16:22 pm
*Axem feverishly readies his Comic Sans MS font files
Title: Re: TrueType font rendering
Post by: m!m on August 02, 2016, 12:17:32 pm
:banghead: I forgot to add the Comic Sans assertion!
Title: Re: TrueType font rendering
Post by: Arkblade on September 08, 2016, 05:32:43 am
I would like to confirm just in case. this support don't mean i18n support. ok?
if it is so, i must be told this again after 5 years ...
I mentioned several times. japanese translation is almost finished 10 years ago. but we still don't have i18n support on the game...
Title: Re: TrueType font rendering
Post by: m!m on September 08, 2016, 05:37:15 am
No, this does not mean that we have i18n support but at least the rendering engine will be able to display those characters once that gets implemented.
Title: Re: TrueType font rendering
Post by: LaineyBugsDaddy on September 08, 2016, 08:53:42 am
Just had a thought. Does support for TrueType fonts also mean OpenType fonts will work too?
Title: Re: TrueType font rendering
Post by: m!m on September 08, 2016, 08:55:13 am
I don't think so but you could always try it.