puklaus's picture

fonts doesnt work with linux (ubuntu 8.04)

Fonts doesnt work with linux (newest svn version of opentk). But with opentk 0.9.1 fonts works fine.

In my code:

init:
ITextPrinter printer = new TextPrinter();
TextureFont font = new TextureFont(new Font(FontFamily.GenericSerif, 24.0f));

draw:
printer.Begin();
printer.Draw("blah - blaa bluu ", font); // this line doesnt work
printer.End();

(printer!=null && font!=null)

output (with svn vers & linux):

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
at OpenTK.Platform.GdiPlus.GetNativeGraphics (System.Drawing.Graphics graphics) [0x00000]
at OpenTK.Graphics.TextureFont.MeasureText (System.String text, SizeF bounds, System.Drawing.StringFormat format, IList`1 ranges) [0x00000]
at OpenTK.Graphics.TextureFont.MeasureText (System.String text, SizeF bounds, System.Drawing.StringFormat format) [0x00000]
at OpenTK.Graphics.TextureFont.LoadGlyph (Char c, System.Drawing.RectangleF& rectangle) [0x00000]
at OpenTK.Graphics.TextureFont.LoadGlyphs (System.String glyphs) [0x00000]

And i tried tutorials, tut3 and 4 (fonts and text) doesnt work, same error.

Missing something, should I write text other way?

Other examples works fine.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

This is a known issue. Font routines have been rewritten more or less from scratch, but some parts are not yet commited to SVN.

keebus's picture

Could you please commit this changings to SVN because I can't run my game on linux for this problem. Thank you.

Kamujin's picture

Can we get an update on this issue? I am experiencing the same issue when I test on Ubuntu 8.04 x64.

For now I have disabled the affected code in my app.

the Fiddler's picture

I've fixed the issue, I just need to clean up and commit the code.

Edit: Commited the fix, but there are still pending issues with fonts on Linux.