Different Font

Aug 30, 2010 at 1:15 PM

Hello Tom

is it possible to use different FONT from GlFontFamily?

i need to use Segoe font family.

Can I do that? and in what way?

regards

 

Coordinator
Aug 30, 2010 at 5:12 PM

not yet, but it will!

When a font is first used, a cache file is created which is faster to load than creating the font texture and vectors on the scratch.

Instead of creating this cache, you can also use a cache which comes from elsewhere with any kind of font! This could even be a font with multiple colors.

the only thing right  now that's missing is an external designer who will create the cache file to use, and then you can use the FontSprite.FromStream() to load that font.

Windows Mobile itself does only have 2 kind of fonts available

But notice, that there might be some copyrights on a font which prohibits distribution!

Microsoft says: "Do not post Segoe WP fonts for redistribution or package with an application – this would violate the license terms of the font"

(http://go.microsoft.com/?linkid=9713252)

 

 

 

Aug 30, 2010 at 6:45 PM

Tom thanks for great and usefull explanation.

Coordinator
Aug 30, 2010 at 9:54 PM

with the latest change set you can do this:

    public static class FontPool
    {
        public static readonly FontSprite BigRegularFont = FontSprite.FromFont("Segoe UI", 16, FontStyle.Bold);
        public static readonly FontSprite MediumRegularFont = FontSprite.FromFont("Segoe UI", 14, FontStyle.Regular);
        public static readonly FontSprite HubFont = FontSprite.FromFont("Segoe WP Light", 32, FontStyle.Regular, "Outlok", "Outlok");

    }

Aug 31, 2010 at 6:32 AM

Tom

thanks for that usefull implementation

Aug 31, 2010 at 2:10 PM
Edited Aug 31, 2010 at 4:50 PM

TOM

if i use this new fontsprite in a hub in which i have an image backgroung i got an exception on Texture size.

I used this kind of code.

             Texture image = panoramaImage;
             hub = new Hub
             {
                 PanoramaImageOpacity = 200,
                 Title = "people",
                 Margin = Margin.Zero,
                 PanoramaImage = image,
                 TitleFont=FontPool.HubFont,
                 TitleFontScale = 1.0f
             };
The problem exist also if you use normal fontsprite.
Coordinator
Sep 2, 2010 at 9:23 PM

try a smaller font size. The font in the demo can be very big as i use only the characters "Outlok" (if you where wondering what this is about). And of course it's expected to have the specified font available in the fonts folder, which by default is only arial unless you copy them from elsewhere which would violate the licence terms of the font.