• Home
  • Products
    • Game Engine
      • Base
      • Mathematics
      • Geometry
      • Physics
      • Particles
      • Animation
      • Graphics
      • Game
      • Game UI
    • Windows Forms
      • Docking Windows
      • Text Editor Control
  • Downloads
  • Buy
    • Overview
    • Professional
    • Indie
    • Non-Commercial
  • Support
    • Overview
    • Blog
    • Forum
    • License FAQ
    • Documentation
  • About
    • About Us
      • Services
    • Contact Us
    • Press
    • Legal Terms
      • Imprint (English)
      • Imprint (German)
Select the search type
 
  • Site
  • Web
Search
DigitalRune.com
Login |Register
NEWS News RSS Feed BLOG Blog RSS Feed FORUM News RSS Feed DOCUMENTATION DigitalRune Software on YouTube DigitalRune Software on Twitter
You are here: SupportForum

If you want to contribute to the forum discussions, please Register or Login.

SearchHome
  • 1
  • 2
  • 3
  • 4
  • 5
HomeHomeDigitalRune Sof...DigitalRune Sof...Game EngineGame EngineGame.UI multiple fontsGame.UI multiple fonts
Previous
 
Next
New Post
10/17/2011 6:29 PM
 
pfisch
No Ranking

Joined: 9/16/2011
Posts: 11
Game.UI multiple fonts  Modified By pfisch  on 10/17/2011 6:29:31 PM

When you make a new textblock you are able to alter the font member variable.  However, this variable wants a string and not a spritefont.  So I assume there is a dictionary somewhere that I load my fonts in.  Where is this and how do I access it?

 

Also I am assuming this will allow me multiple gui fonts.  If I am not right than I don't care about my previous question and instead I just want to know how to have a bunch of gui fonts that I can control.

 
New Post
10/17/2011 8:09 PM
 
HelmutG
6th Level Poster

www.digitalrune.com
Joined: 10/15/2006
Posts: 565
Re: Game.UI multiple fonts 

You can define several fonts in the Theme.xml. Here is an excerpt of the WindowsPhone7 example theme:

01....
02.  <Fonts>
03.    <Font Name="Segoe15" File="Segoe15.spritefont" IsDefault="True"/>
04.    <Font Name="Segoe17" File="Segoe17.spritefont"/>
05.    <Font Name="Segoe17Semilight" File="Segoe17Semilight.spritefont"/>
06.    <Font Name="Segoe19" File="Segoe19.spritefont"/>
07.    <Font Name="Segoe19Semibold" File="Segoe19Semibold.spritefont"/>
08.    <Font Name="Segoe24Semilight" File="Segoe24Semilight.spritefont"/>
09.    <Font Name="Segoe32Semilight" File="Segoe32Semilight.spritefont"/>
10.    <Font Name="Segoe54" File="Segoe54.spritefont"/>
11.  </Fonts>
12. 
13....
14.  <Styles>
15....
16.    
17.    <Style Name="TextBlockLarge" Inherits="TextBlock">
18.      <Font>Segoe24Semilight</Font>
19.      <State Name="Default" />
20.      <State Name="Disabled">
21.        <Foreground>255;255;255;102</Foreground>
22.      </State>
23.    </Style>
24.     
25.     
26.    <Style Name="TextBlockExtraLarge" Inherits="TextBlock">
27.      <Font>Segoe32Semilight</Font>
28.      <State Name="Default" />
29.      <State Name="Disabled">
30.        <Foreground>255;255;255;102</Foreground>
31.      </State>
32.    </Style>
33....

 

At runtime you can get the fonts from the renderer: method IUIRenderer.GetFont().

At runtime the fonts are stored in the theme class: property Theme.Fonts

 
 Page 1 of 1
Previous
 
Next
HomeHomeDigitalRune Sof...DigitalRune Sof...Game EngineGame EngineGame.UI multiple fontsGame.UI multiple fonts


DigitalRune is a trademark of Garstenauer Information Technology OG.

Garstenauer Information Technology OG
Weingartenstrasse 35, 4452 Ternberg
Austria (EUROPE)
office@digitalrune.com

Home Products Downloads Buy Support About Us
Game Engine Particles Windows Forms Professional Blog Services
Base Animation Docking Windows Indie Forum Contact Us
Mathematics Graphics Text Editor Control Non-Commercial License FAQ Press (News)
Geometry Game Documentation Legal Terms
Physics Game UI Imprint
Impressum
Copyright © 2006-2012 Garstenauer Information Technology OG Terms Of UsePrivacy Statement