Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8495089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:28:24+00:00 2026-06-10T23:28:24+00:00

I’m having problems in rendering custom textblock with custom font resource on liveTile ?

  • 0

I’m having problems in rendering custom textblock with custom font resource on liveTile ?

My project updates a live tile in background. but it should be personalized.

Im using this code. but its does not woks, the text shows blank when i try to use an embedded font
the bitmap background works just fine. But the fonts does not works.

When i use this same code in “foreground agent” the fonts shows perfectly.

Grid grid = new Grid();

// load your image 
StreamResourceInfo info = Application.GetResourceStream(new Uri("tile.jpg", UriKind.Relative));

// create source bitmap for Image control (image is assumed to be alread 173x173)
WriteableBitmap wbmp2 = new WriteableBitmap(1, 1);
wbmp2.SetSource(info.Stream);
Image img = new Image();
img.Source = wbmp2;

// add Image to Grid
grid.Children.Add(img);

TextBlock text = new TextBlock() 
{
    FontFamily = new FontFamily("/MyTaskAgent;component/Fonts/Fonts.zip#Buxton Sketch"),
    Foreground = new SolidColorBrush(Colors.Black) ,
    TextWrapping = TextWrapping.Wrap,
};

text.Text = "Test";

// this is our final image containing custom text and image
WriteableBitmap wbmp = new WriteableBitmap(173, 173);

// now render everything - this image can be used as background for tile
wbmp.Render(grid, null);
wbmp.Invalidate();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T23:28:26+00:00Added an answer on June 10, 2026 at 11:28 pm

    I had a similar problem, and found a solution, please have a look here or here

    I boils down to either
    1. creating a hidden textblock that use the font before doing the conversion, or
    2. creating a FontSource.

    I used the first because it was simpler for now.

    The textblock is hidden, but it ensures that the embedded font is loaded.

    Inside my control, I added the following:

    void Grid_Loaded(object sender, RoutedEventArgs e) {
    #if SILVERLIGHT
        Grid Grid = (Grid)sender;
        AddFontLoaderTextBox(Grid, "Signs Road Features");
        AddFontLoaderTextBox(Grid, "Signs G Old");
        AddFontLoaderTextBox(Grid, "Signs G");
        AddFontLoaderTextBox(Grid, "Signs G1");
        AddFontLoaderTextBox(Grid, "Signs G2");
        AddFontLoaderTextBox(Grid, "Signs G3");
        AddFontLoaderTextBox(Grid, "Signs Info");
        AddFontLoaderTextBox(Grid, "Signs Regulatory");
        AddFontLoaderTextBox(Grid, "Signs Regulatory1");
        AddFontLoaderTextBox(Grid, "Road Manager");
        AddFontLoaderTextBox(Grid, "Signs Temporary");
        AddFontLoaderTextBox(Grid, "Road Manager");
        AddFontLoaderTextBox(Grid, "Signs Warning");
        AddFontLoaderTextBox(Grid, "Signs Warning1");
    #endif
    }
    
    #if SILVERLIGHT
    void AddFontLoaderTextBox(Grid Grid, string fontName) {
    
        TextBlock TextBlock = new TextBlock();
        TextBlock.FontFamily = new FontFamily(string.Format(
            "pack://application:,,,/ITIS.Controls.LinearViewer.Silverlight;component/Fonts/{0}.ttf#{0}", fontName));
        TextBlock.Opacity = 0; /* hide the text block, we only load it for the font to be cached */
        Grid.SetRowSpan(TextBlock, 3); /* just to ensure the text block doesn't affect the size of the first row */
        Grid.Children.Insert(0, TextBlock); /* keep underneath other children */
    }
    #endif
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
This could be a duplicate question, but I have no idea what search terms
Seemingly simple, but I cannot find anything relevant on the web. What is the
I want to construct a data frame in an Rcpp function, but when I
I'm having trouble keeping the paragraph square between the quote marks. In firefox the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.