Standalone DynamicSpriteFontGenerator 0.4 (Generate fonts without XNA Game Studio)

mistzzt

Terrarian

Attachments

  • DFG_0.6.7z
    428.5 KB · Views: 2,417
Tried it out, got an error:

OZnW6q2.png
 
Tried it out, got an error:

OZnW6q2.png
Seems you had installed XNA Game Studio, And the program attempted to load the vanilla DLL.
I used a modified Microsoft.Xna.Framework.Content.Pipeline.dll.
Please let the program load the dll in 7z.
 
Seems you had installed XNA Game Studio, And the program attempted to load the vanilla DLL.
I used a modified Microsoft.Xna.Framework.Content.Pipeline.dll.
Please let the program load the dll in 7z.
Makes sense. Someone else will have to try it on a computer without XNA installed.

I'm not sure how to force the program to load the dll in the same folder as it though.
 
Makes sense. Someone else will have to try it on a computer without XNA installed.

I'm not sure how to force the program to load the dll in the same folder as it though.
I'll rewrite the program using reflection for solving this problem if I have time.
 
It's not a big deal. I already have XNA installed, so I can just build an xna content project to make a dynamicspritefont. I was just curious to see how much easier this would be.
 
Just tried it again with the new version, ran into another problem:

Code:
Description file detected: 1
* ExampleFont.dynamicfont

Start loading description file: ExampleFont.dynamicfont ..Done!
Start compiling font.
Unhandled Exception: System.NotImplementedException: The method or operation is not implemented.
   at DynamicFontGenerator.DfgContext.get_Logger() in C:\Users\zitwa\Source\Repos\DynamicFontGenerator\DynamicFontGenerator\DfgContext.cs:line 11
   at Microsoft.Xna.Framework.Content.Pipeline.Processors.FontDescriptionProcessor.Process(FontDescription input, ContentProcessorContext context)
   at ReLogic.Content.Pipeline.DynamicFontProcessor.Process(DynamicFontDescription input, ContentProcessorContext context)
   at DynamicFontGenerator.Generator.CompileFonts() in C:\Users\zitwa\Source\Repos\DynamicFontGenerator\DynamicFontGenerator\Generator.cs:line 83
   at DynamicFontGenerator.Generator.Initialize() in C:\Users\zitwa\Source\Repos\DynamicFontGenerator\DynamicFontGenerator\Generator.cs:line 51
   at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
   at DynamicFontGenerator.Generator.Main() in C:\Users\zitwa\Source\Repos\DynamicFontGenerator\DynamicFontGenerator\Generator.cs:line 22
 
Just tried it again with the new version, ran into another problem:

Code:
Description file detected: 1
* ExampleFont.dynamicfont

Start loading description file: ExampleFont.dynamicfont ..Done!
Start compiling font.
Unhandled Exception: System.NotImplementedException: The method or operation is not implemented.
   at DynamicFontGenerator.DfgContext.get_Logger() in C:\Users\zitwa\Source\Repos\DynamicFontGenerator\DynamicFontGenerator\DfgContext.cs:line 11
   at Microsoft.Xna.Framework.Content.Pipeline.Processors.FontDescriptionProcessor.Process(FontDescription input, ContentProcessorContext context)
   at ReLogic.Content.Pipeline.DynamicFontProcessor.Process(DynamicFontDescription input, ContentProcessorContext context)
   at DynamicFontGenerator.Generator.CompileFonts() in C:\Users\zitwa\Source\Repos\DynamicFontGenerator\DynamicFontGenerator\Generator.cs:line 83
   at DynamicFontGenerator.Generator.Initialize() in C:\Users\zitwa\Source\Repos\DynamicFontGenerator\DynamicFontGenerator\Generator.cs:line 51
   at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
   at DynamicFontGenerator.Generator.Main() in C:\Users\zitwa\Source\Repos\DynamicFontGenerator\DynamicFontGenerator\Generator.cs:line 22
Strange.
I've tried compile a font using v0.5, and it worked; no idea why it became this.
Now, I changed some code trying to fix the exception you encountered; if you have time, please try version 0.6.
 
Confirmed working! I have XNA installed btw; thanks for the tool! :D (can't seem to find out how to do it with visual studio...)
 
It can't find the font family even though I got it installed, I even put the font files into the directory but it still crashed, any ideas how to fix this?
 
Is there a way to determine the line height? The two options of VerticalOffset don't seem to fit exactly.
 
  • Like
Reactions: 250
Is there a way to determine the line height? The two options of VerticalOffset don't seem to fit exactly.
I got this problem too, my text was out of the box like this......No matter it's in DefaultFontAscent or MaxAscent.
微信图片_20200719204439.png
 
I still have problems wanting to create my own font, I don't know how and I still don't understand.

Code:
Description file detected: 1
* SampleFont.dynamicfont


Start loading description file: SampleFont.dynamicfont ..Done!
Start compiling font.
Excepción no controlada: Microsoft.Xna.Framework.Content.Pipeline.InvalidContentException: The font family "Source Han Sans SC Regular" could not be found. Please ensure the requested font is installed, and is a TrueType or OpenType font.
   en Microsoft.Xna.Framework.Content.Pipeline.Processors.FontRasterizer.CreateFont(FontDescription description)
   en Microsoft.Xna.Framework.Content.Pipeline.Processors.FontRasterizer..ctor(FontDescription description)
   en Microsoft.Xna.Framework.Content.Pipeline.Processors.FontDescriptionProcessor.Process(FontDescription input, ContentProcessorContext context)
   en ReLogic.Content.Pipeline.DynamicFontProcessor.Process(DynamicFontDescription input, ContentProcessorContext context)
   en DynamicFontGenerator.Generator.CompileFonts() en C:\Users\zitwa\Source\Repos\DynamicFontGenerator\DynamicFontGenerator\Generator.cs:línea 83
   en DynamicFontGenerator.Generator.Initialize() en C:\Users\zitwa\Source\Repos\DynamicFontGenerator\DynamicFontGenerator\Generator.cs:línea 51
   en Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
   en DynamicFontGenerator.Generator.Main() en C:\Users\zitwa\Source\Repos\DynamicFontGenerator\DynamicFontGenerator\Generator.cs:línea 22
 
This tool generates .xnb font files for Terraria 1.3.5.X, which doesn't need XNA Game Studio.

If you can run Terraria, then you can use this tool.

You simply need to create your description file (.dynamicfont) on the directory of the tool, and run DynamicFontGenerator.exe

A simple description file can be found here: Sample description file for dynamic font generator of Terraria

Source code: GitHub - mistzzt/DynamicSpriteFontGenerator: Generate custom font for Terraria with no dependencies required.
I'm new to terraria's customization. What do i do after i got the font i want in .xnb format? it's called "RoadbrushW01-Regular.xnb"
 
I still have problems wanting to create my own font, I don't know how and I still don't understand.

Code:
Description file detected: 1
* SampleFont.dynamicfont


Start loading description file: SampleFont.dynamicfont ..Done!
Start compiling font.
Excepción no controlada: Microsoft.Xna.Framework.Content.Pipeline.InvalidContentException: The font family "Source Han Sans SC Regular" could not be found. Please ensure the requested font is installed, and is a TrueType or OpenType font.
   en Microsoft.Xna.Framework.Content.Pipeline.Processors.FontRasterizer.CreateFont(FontDescription description)
   en Microsoft.Xna.Framework.Content.Pipeline.Processors.FontRasterizer..ctor(FontDescription description)
   en Microsoft.Xna.Framework.Content.Pipeline.Processors.FontDescriptionProcessor.Process(FontDescription input, ContentProcessorContext context)
   en ReLogic.Content.Pipeline.DynamicFontProcessor.Process(DynamicFontDescription input, ContentProcessorContext context)
   en DynamicFontGenerator.Generator.CompileFonts() en C:\Users\zitwa\Source\Repos\DynamicFontGenerator\DynamicFontGenerator\Generator.cs:línea 83
   en DynamicFontGenerator.Generator.Initialize() en C:\Users\zitwa\Source\Repos\DynamicFontGenerator\DynamicFontGenerator\Generator.cs:línea 51
   en Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
   en DynamicFontGenerator.Generator.Main() en C:\Users\zitwa\Source\Repos\DynamicFontGenerator\DynamicFontGenerator\Generator.cs:línea 22
extremely late reply but
make sure to check the fonts you installed. you may want to change the font to other font name you installed

I'm new to terraria's customization. What do i do after i got the font i want in .xnb format? it's called "RoadbrushW01-Regular.xnb"
all you have to do is to put it in C:\Users\<username>\Documents\My Games\Terraria\ResourcePacks\<your font resource pack directory>\Content\Fonts
and then rename it to one of the following:
  • Combat_Crit.xnb
  • Combat_Text.xnb
  • Death_Text.xnb
  • Item_Stack.xnb
  • Mouse_Text.xnb
 
This tool generates .xnb font files for Terraria 1.3.5.X, which doesn't need XNA Game Studio.

If you can run Terraria, then you can use this tool.

You simply need to create your description file (.dynamicfont) on the directory of the tool, and run DynamicFontGenerator.exe

A simple description file can be found here: Sample description file for dynamic font generator of Terraria

Source code: GitHub - mistzzt/DynamicSpriteFontGenerator: Generate custom font for Terraria with no dependencies required.
6 entire years and I don't know if this thing still works at all

I keep trying everything, but to no avail


A WELL DESERVED EDIT:
The reason why my attempts failed is because I didn't save the description file as a .dynamicfont file, instead changing a former .spritefont file manually!
I created a new .dynamicfont file and now the tool works!
 
Last edited:
Back
Top Bottom