×

Discussion Board

Results 1 to 15 of 15
  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    52

    Fonts work with hard coded strings but not Resource strings

    Fonts work with hard coded strings but not Resource strings
    I had a hard coded english only app
    I've just converted to resourses and added other languages
    all is working - except some of the capital letters in are not appearing in the correct embedded font
    its all ok in the xaml editor but not on the device / emulator

    oddly its not ALL capitals - only some.

    anyone come across this.

    all the lowercase letters are appearing just fine.

    thanks

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    419

    Re: Fonts work with hard coded strings but not Resource strings

    If you set the same string as in the Resource file directly in code, does it display correctly or does it have the same issue? I'm trying to find out wether it could be due to the storage in the resource file or if it has to do with some characters (e.g. Á, Ö, etc.) not being defined in the Font you're using so that the App reverts to the default font for them.

  3. #3
    Registered User
    Join Date
    Sep 2009
    Posts
    52

    Re: Fonts work with hard coded strings but not Resource strings

    No its on simple words like Fruit
    if I hard code Fruit - its fine, from the resources the F appears in the wrong font. oddly Smoothys appears fine so that Capital is ok
    its WIERD!

  4. #4
    Registered User
    Join Date
    Sep 2009
    Posts
    52

    Re: Fonts work with hard coded strings but not Resource strings


    Heres the spanish version - but the english is equally CAPITAL challenged. smoothy is the same in both. and that capital works.

  5. #5
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    419

    Re: Fonts work with hard coded strings but not Resource strings

    What happens if you programmatically try to read the text from the Resource file and compare it to the hard-coded string. Are there any differences in the String?

    Can you reproduce the issue in a small sample project or is it only happening in that particular project?

  6. #6
    Registered User
    Join Date
    Sep 2009
    Posts
    52

    Re: Fonts work with hard coded strings but not Resource strings

    well this simple test said yes
    if (AppResources.fruitText == "Fruit")
    {
    Debug.WriteLine("YAYA!");

    }

  7. #7
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    419

    Re: Fonts work with hard coded strings but not Resource strings

    So most likely it will work just fine if in code behind you do this assignment:

    txbText.Text = AppResources.fruitText;

    Curious if this behavior only appears when using DataBinding... I fear I'm at the end with my suggestions. Hope someone else has a good idea on what the reason for this behavior might be.

  8. #8
    Registered User
    Join Date
    Sep 2009
    Posts
    52

    Re: Fonts work with hard coded strings but not Resource strings

    ah good idea - ill try coding them as well as the xaml definitions see if that fixes it
    will be tomorrow now as im home and sans dev machine (an intel NUC i have on my desk)

    Quote Originally Posted by SB Dev View Post
    So most likely it will work just fine if in code behind you do this assignment:

    txbText.Text = AppResources.fruitText;

    Curious if this behavior only appears when using DataBinding... I fear I'm at the end with my suggestions. Hope someone else has a good idea on what the reason for this behavior might be.

  9. #9
    Registered User
    Join Date
    Sep 2009
    Posts
    52

    Re: Fonts work with hard coded strings but not Resource strings

    FIXED!!!

    after a morning of trying every combination of things
    i ended up hard coding the string in xaml and setting to the resourse in code and it worked
    BUT only for the letter in that string other random ones were broken

    THEN
    i hardcoded it to all the UPPER CASE characters and suddenly its all working
    it seems blend embedded fonts only embed the characters present in the xaml file.
    is there a way (other than a text field with the whole character set in it) to embed the whole font?

  10. #10
    Registered User
    Join Date
    Sep 2009
    Posts
    52

    Re: Fonts work with hard coded strings but not Resource strings

    ok so going into blend and font manager
    all the embed boxes were ticked, BUT!!! this included auto fill
    which seems to override all the other settings
    adding in the charracters in the bottom also worked but autofill OFF fixed it

    such fun

  11. #11
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    419

    Re: Fonts work with hard coded strings but not Resource strings

    Happy to see that you found the reason for the problem. Thx for sharing the solution.

  12. #12
    Registered User
    Join Date
    Sep 2009
    Posts
    52

    Re: Fonts work with hard coded strings but not Resource strings

    yep now i have to do 6 screen grabs (2 per resolution) x 4 languages!!

    ive just added french, spanish and german for starters

    russian would seem prudent - but that will need a resource dependant font- I'll leave that for another day!!!

  13. #13
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    419

    Re: Fonts work with hard coded strings but not Resource strings

    Dev Center is able to create the screenshots for the lower resolutions from the WXGA ones now. I don't know how good a job it does at that though. But it would reduce the effort required. I do believe doing them yourselves is the better solution though. Just thought I'd mention that change.

  14. #14
    Registered User
    Join Date
    Sep 2009
    Posts
    52

    Re: Fonts work with hard coded strings but not Resource strings

    yep i kinda realised that after creating all the shots in the 3 resolutions.
    it was only about 20-30 minutes to do it properly so worth while.

  15. #15
    Registered User
    Join Date
    Sep 2009
    Posts
    52

    Re: Fonts work with hard coded strings but not Resource strings

    the app is live now

    http://www.windowsphone.com/en-gb/st...97?signin=true

    getting some nice reviews

Similar Threads

  1. How to load Strings from Resource?
    By slohtia in forum [Archived] Beginning Qt
    Replies: 6
    Last Post: 2011-02-23, 08:59
  2. loading strings from a resource file in QT
    By GuusDavidson in forum [Archived] Beginning Qt
    Replies: 5
    Last Post: 2011-02-04, 14:24
  3. Question about resource localization strings.
    By vql in forum Symbian C++
    Replies: 5
    Last Post: 2009-07-27, 09:27
  4. Resource Strings - Maximum Length
    By MethodSolutions in forum Symbian C++
    Replies: 1
    Last Post: 2006-07-24, 00:05
  5. Strings from resource file
    By Danack in forum Mobile Java General
    Replies: 2
    Last Post: 2003-06-05, 01:54

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •