Okay, you're going to have to forgive me for not giving you specific XNA code, because I'm not knowledgeable in that platform, but what I'm going to tell you should work on any game engine that lets you draw sprites.
Fonts is not your only problem, so I'm going to give you a piece of advice, and then I'm going to answer your question. With these two things, ...
It's easy: Fonts do not need to match resolution, they need to match pixel density.
Pixel density is measured as pixels per inch(PPI), or pixels per centimeter. There's also a measure unit called density independent pixels(DP). It is defined that 1dp is the size one pixel has on a 160 PPI screen.
Now coming back to fonts, try to make this test: put your ...
You seem to want to keep the same textsize/screensize ratio. Basically what you do is develop at one resolution and let that be scale 1.0. Then you divide the new screen width by the old width and that is your scale factor.
Developing on 2560x1440 with font size 16 and running on 1920x1080.
Font size will be: 1920 * 16 / 2560 = 12
I do the ...
If you use a font rendering engine like FreeType, then the most common mistake is to re-render strings every frame. This is pointless, because when you render a string, it will usually be on the screen unchanged for at least a few seconds.
When you want to display a text, render that text to a texture once and then draw that texture instead of re-rendering ...
Can be integrated into any existing codebase, whether it's OpenGL, DirectX, DirectDraw or even GDI+.
Fast. Using a texture atlas, you can render all your text in a single pass.
Artist-controlled. Texture atlases can be procedurally generated (rendering a font style to a texture) or they can be loaded from a file. Artists can then ...
Flexible & Accurate: Filters
Use a texel filter either on the texture on the CPU side, or if you are using programmable pipeline OpenGL, directly in the fragment shader.
The idea of a filter is simply that you run through a 2D loop to process every texel. If it is white, then you run through an inner 2D loop for each of its surrounding pixels in some ...
This feature is implemented directly in FTGL but it is only available in the ExtrudeFont class. You simply define an outset for the font:
font = new FTExtrudeFont(...);
Then you can use a different colour for the two render modes:
glColor3f(1.0, 1.0, 1.0); /* White inside */
Well, like someone else said, in XNA, spritefont does the heavy lifting for you. on the creators club website there is a bitmap font exporter that exports in XNA style font images. (http://xbox.create.msdn.com/en-US/education/catalog/utility/bitmap_font_maker) Then, you can open it in photoshop or whatever and make it look pretty. From there, you add the ...
So what I had been thinking has been confirmed: The dialog is built with a single NinePatch so you need to adjust the size of the title bar manually within the .atlas file and .png file.
This will basically be a little How to use a JSON file with LibGdx tutorial.
LibGdx has a very useful Class called Skin. It allows you to have a .json file along with ...
From this topic: http://badlogicgames.com/forum/viewtopic.php?t=8573&p=38930
You should try not to do the following: (Quote from one of the GDX creators)
.. draw stuff from both ...
And from me - Don't use ShapeRenderer for drawing - it's for debugging purposes.
Instead of this create a ...
Truetype fonts are vector based. So you would have to trace the glyphs with a vector editor and then use a program like FontForge (which also is a vector editor) to build a font from that.
That said, You do not need to use TTF fonts in MonoGame since it just renders the font to a texture at compile time.
There are many bitmap font programs/examples ...
If you want to use SDL_ttf, then you have no choice but using TTF fonts, see the doc:
SDL_ttf supports loading fonts from TrueType font files, normally ending in .ttf, though some .fon files are also valid for use.
Now if OTF is still an option you would consider (even if there's no SDL_otf, which means you'll have to implement it), it's potentially a ...
The solution is quite simple and is used by a great number of games. All you have to do is treat your fonts as if they were sprites.
Have your designer draw out the entire range of numbers and letters that you want to use in your game. Then render them to varying sized static images (.png, .bmp, whatever format you use). You'll have something like this:
The problem with resizing spritefonts is that when you make the spritefont, a file is made with an image of the font at the size you specify in the xml file. Because of this, you are not going to get the scalability of vector fonts, meaning that when you make your fonts bigger they will be blurry. The only way around this is to create several sprite fonts of ...
I haven't tried this out, so some experimentation would be needed to see if it actually works.
What I would do:
Start from a vectorized format that follows the drawing direction. As an example, the hershey fonts - the "scripts" and "scriptc" fonts might be a good starting point:
Next, instead of drawing the fonts as line segments, render them as splines. ...
The reason you are getting this behaviour is because of coordinate system. The base coordinate for your sprites is "left,bottom" (classic Cartesian) however all offsets in fnt files are assuming inverted Y axis (drawing from "left,top" of the sprite).
So instead of (you may notice this gives correct align, but on the top, i.e. g goes up instead of down):
The fileformat.info page you linked to contains a link “Fonts that support this block”. The ones listed there with 100% support are—
Everson Mono (cost: €25; license: Everson Mono Shareware License), and
GNU Unifont (cost: free; license: GNU GPL, with virality-exemption for embedding)
My approach is to do the following:
Convert your font file to an image
Store each character as a VAO (use a loop to store them all - array index = unicode number)
Use a sprite batch to draw the text whenever its needed
Below is a snippet of my Java sprite batching code, used to draw the text.
public void draw(final String text, final float sx, final float ...
If you cannot find a single font containing all glyphs you want, you will have to have multiple fonts.
Some text rasterisation APIs have "font linking" or "font substitution" in which they use more than one font as fallback for missing glyphs. This tends to result in a sub-optimal result in terms of character advances, relative glyph size, and kerning - but ...
Yes, Freetype is reasonable.
If you use .png files, you have to make one for EVERY size and EVERY color, and that may occupy 10 times the space a .ttf file takes up. Goodbye, free space on android and iOS devices. Moreover, you just have to get 1 .ttf file, and that's it. Hope I helped you!
I believe this could be an issue with the AssetManager as it uses an objectMap which maps loaded objects to the string used to load them. In this case you're loading the font and the assetManager is storing it in it's objectMap under the key "fonts/Roboto-Regular.ttf", then when you load your font again with second set of parameters the previous font is ...
The intent of Condition #5 of the Open Font License seems to simply be to clarify the following:
You do need to provide this license alongside your usage of the font, but
This license applies just to the font, and doesn't affect whatever you're using the font to produce.
In other words, the license is clarifying that it is not a viral license such as the ...
// --- Array of sprite sheet offset for letter variants, indexed by letter
// --- Note ...
If you are referring to your in-game fonts, you do not need to install the custom fonts in order to use them with your compiled game. When compiled, your fonts get converted to .XNB files, which are packaged in in your /bin directory and are used to draw in game.
Perhaps you could try scissor testing the window when drawing text?
glScissor(windowX, windowY, windowSizeX, windowSizeY);
CFontManager::Instance().renderWrappedText(font, lineLength, position, text);
You can also apply this to everything within the window as a single, unified solution.
I don't know about the platform you're using, but there are mostly three ways to center text. Not all of them are available on all platforms, so you should check your platform documents and see which one of these is available.
The font rendering system has a flag or option to draw centered text. Look for something like font.textAlignment.
The font rendering ...
This is not an easy problem to solve. If the "multiple sprite fonts" technique doesn't work for you, there's no other built-in way in XNA to get what you want. So you have to do some custom development.
One method is to use Valve's technique, as described in the paper: Improved Alpha-Tested Magniﬁcation for Vector Textures and Special Effects. This involves ...
It's late in the day, but 71Squared has now released a command line app for Glyph Designer that allows you generate your font assets as part of your build process and also specify the size you would like, so you can automatically generate SD/HD output as required by your project.
Do you know how to implement sprites? If yes, then drawing text from a character sheet is easy: just treat each character as a sprite and draw them one after the other.
The details depend on the font you have and on how fancy you want your typography to be. Obviously, the simplest case would be a monospace font, where each character is a constant-size ...
It looks like you are using a scale camera for your game objects (the grid). That's fine. However fonts in libgdx are scaled in pixel dimensions and not your game world units. The best course of action here is to maintain two sperate cameras to render your game: world, and ui.
The world camera will be in your world units as you have it now. The ui camera ...