Font changes during the runtime in WPF app - wpf

I'm using a non English (Hebrew) font in a WPF application. The font was embedded in the project by expression blend.
In the designer I see the font correctly, but during the run time part of the letters are being changed to different font style.
What could it be?

Are the design and runtime environment on the same machine ?
If not, check for installed fonts.
If it's on the same machine, then maybe check if some localization happens on during runtime.

Related

Font changes between design time and runtime (VS 2010 and wpf)

When I create a window or custom control with wpf inside Visual Studio the default font used is Segoue UI 12 (at least on Windows 7). When I execute the application the font really used is Verdana 13, a bit greater, so some signs are cut and the user experience is a poor formatting look and feel. Don't know how to change the default font inside VS 2010 and if it is the best way to achieve the goal of aligning what I see during the design phase and what the user will see at run time.
I checked for the word 'Verdana' in the entire solution and it was not found so I'm quite sure this weird behavior is not due to a style which is applied as a dynamic resource.
Thanks for any help
Filippo
By default, WPF uses system font in runtime. If you want to always use Segoe UI, you can set FontFamily property to "Segoe UI".

Custom Font in WP7 silverlight app

I have an issue, I tried to load a custom font in wp7 silverlight app for my buttons, and it worked nicely. This font supports greek language in word, photoshop etc. But in expression blend or in visual studio when i change the content of the button in greek word then the button fontfamily loads in default font. Why is this happening?
It sounds as though you aren't loading the font correctly.
What are you actually doing. (Show the code. Don't just describe it.)

Is it possible to install different fonts on windows phone 7 emulator?

I made a demo application using Silverlight where I have given certain Unicode of Hindi language to be displayed on a textbox as a text. ऋ ऊ उ ई इ आ, unicode positions are '\u090B', '\u090A', '\u0909', '\u0908', '\u0907','\u0906' respectively.
So when I pass this whole thing as a string to the textbox.text property it shows at the debug time as the exact value is to the textbox but when I go through the emulator the display shows empty boxes.
Is this require installation of different fonts on emulator? If so then how can I do this? Is it possible to build an application for Windows Phone 7 which can support different languages?
You can embed fonts in your WP7 applications in the same way that you embed fonts for any Silverlight application as decribed in the Embedding fonts in Silvelright blog post by Paul Yanez. You simply check the Embed checkbox in the Text pane in Expression Blend.
NOTE: You will need to make sure that you are licensed to use the font in this way or that it is free for use in this way.

Visual Studio and DPI issue

I am developing a Windows Forms application using VS2008 on Windows Vista. I tried to run my application on Windows XP the other day, and everything on GUI was messed up. I realized that I developed the application using 120 Dpi setting on Windows Vista and my XP was set to 96 dpi.
My application has several UserControls and all of them shrinks even in the Visual Studio itself if I change my DPI to 96. I am sure a lot of people are using Visual Studio in high DPIs these days. So how can make sure that my GUI does not get messed up both in Visual Studio and runtime?
EDIT: I have read couple articles on this issue and I learned that I should be setting AutoScaleMode to None. However, this still does not prevent my labels to adapt new DPI settings enforced by the operating system. I need a way to prevent my labels to grow/shrink because other GUI elements have fix sizes.
It has been a while since I worked on this issue, but try setting AutoSize = False. In addition, UseCompatibleTextRendering = True might help.
This is a rather old question, but I want to share my solution/opinion. I ran into a similar problem recently. Actually, I want Visual Studio to keep my WinForms as they are, but them to scale at runtime. I found no consistent summary on how to correctly do that. After some reading and experimenting I came to this solution:
Keep the Form’s AutoScaleMode = Font.
Set in your Forms Designer: Font = MS Sans; 11px
In the Forms Ctor, after InitializeComponent, set: Font = SystemFonts.DefaultFont
Enable DPI-Awareness, either through a manifest or by API function SetProcessDPIAwareness
Since AutoScaleMode remains active, all DPI-changing magic works, even per-monitor DPI awareness. What remains, is designing Forms in a way scaling works nicely.
I wrote the details on my Blog: http://www.sgrottel.de/?p=1581&lang=en

Silverlight - Embedded font fails to load... sometimes

I have Silverlight application that is using an embedded font. The font works as expected 98% of the time. However, some of the time the font never loads. I don't get any errors, it just renders all text in a fall back font. Has anyone else run into this? Any ideas on what could be causing it?
Ran into the same issue. Assuming you have the font file set as a 'Resource' and 'Do not copy option' under build options. Here is what fixed it in my project.
When the font file was referenced directly, it would work about 75% of the time...
FontFamily="./Folder/FontFile.TTF#Font Name"
For class libraries the syntax is different, once I switched to using this syntax the font always loaded.
FontFamily="AssembyName;component/Folder/FontFile.TTF#Font Name"
In my project, if you select the font using in the property settings for the control using Visual Studio, it defaulted to option 1, which was unreliable.

Resources