I wish to have fonts resize with user resolution while having text as sharp as they can. By which I also mean they keep a scale of 1.0f in SpriteBatch.DrawString(). After thinking about several solution and trying a few, I’ve decided the simplest/best thing to do is use the MG pipeline’s spritefont generation code to generate a sprite. Only as required at game startup and after changing resolution and/or UI scale so there’s barely a speed impact - none while actually playing. What’s more, I can (most likely) use the current spritebatch code, etc… So my code should be quite brief, and updates to the pipeline should slot in quite easily.
This experiment has humbled me - at least in my knowledge of C#. I’ve learned several new things, but couldn’t find the entry point of the pipeline (the proverbial Main.cs, Pipeline.cs or Program.cs). Despite no VS solution/project I did manage to backtrack from FontDescription pretty well. Now I’m stuck on SharpFont. Never handled DLLs before (although it seems relatively easy), but I can’t find any DLL import in the pipeline source code. The SharpFont.dll and freetype6.dll aren’t included - the folder ThirdParty/Dependencies is empty. I could just muddle through and try writing my own DLL import, but that seems less than ideal.
Q1: How and/or where does the MG Pipeline code import SharpFont.dll (and perhaps freetype6.dll)?
Q2: This spritefont generation code works on Win, Linux and Mac desktops, correct? (after research various Git issues, I think Win and Linux yes, Mac not yet)
Also - and unrelated to SharpFont - why does SpriteFontContent.cs have
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;
I understand every class used in SpriteFontContent.cs has it’s own _Class_Writer.cs (e.g. SpriteFontContentWriter.cs, ListWriter.cs or Texture2DContentWriter.cs) but are those writer classes used automagically? I can’t see the link in the code.
Q3: Why or how is Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler used in SpriteFontContent.cs?
Currently installed (for projects) MonoGame 3.5 stable. Copying code of Git source MonoGame-develop (11210 commits) downloaded 2017/02/08. SharpFont.dll and freetype6.dll are included in the MG 3.5 installation (C:/Program Files (x86)/MSBuild/MonoGame/v3.0/Tools). With a file date of 2016/03/30, these appear to be v3.0.1.