I'm using Visual Studio 2010.
I want to build an application displaying some text with custom fonts.
All the fonts are TrueType fonts, with the editable attribute, and are declared as resource with "Copy Always".
But, even at design time, some fonts are replaced by the standard Silverlight font, in the XAML editor.
For example I have 14 different versions of the Helvetica font (bold, oblique, italic, narrow, condensed... and mix of those). But only 3 are correctly displayed, others are using the fallback font. If I open the ttf files with the windows font preview application everything looks ok.
Any idea of what can be wrong ?
Thanks for your help.
After two months of hair pulling I've finally come with a simple solution :
Don't use - (dash) in your embedded font names
I hope it can help somebody.
Related
I have been using Fontawesome 5.6 (free) in a winforms project, and rendered glyphs by referencing the character code into a variable. "&HF084" would show the Key character in VB.net for example.
The latest versions of Fontawesome, like 5.10, while still having the same character codes for the same icons, don't always render the icon, even if it's available in the free version I'm using.
I have noticed in a few comments, that specifying weight would fix the issue, at least for css rendering.
Specifying Bold style under a label with the font does fix the issue of non-rendering icons, however they are rendered much more heavy than they should be. Previously specifying Regular font style used to work for all icons, however that is not the case now.
As far as I'm aware I can't specify weight of a font by point in winforms, just specify the style (regular, bold, underlined, etc.)
EDIT: For more information, I am using the ttf font files that come in the web folder of the web zip file of fontawesome. The reason for this is that otf file format doesn't work on Windows server 2003, which is an environment that will run the WinForms app.
OK, so I have built a Windows Form application. I now want an icon for it. So I use the Icon Editor built into Visual Studio 2012. Draw it all out to look nice and purdy. Once I am done, I have a .ico file and I make it the default icon for the project, and also the icon for the one WinForm in the application.
Unfortunately, it does not show up as I have created it! It is displayed as the default icon file as it existed before I modified it in the icon editor. It's a 32x32 4 bit icon. If I change the extension to .bmp it shows up as the default.
It looks like the VS icon editor is editing something else, not the appearance of the icon. Can someone tell me what I am doing wrong?
I used to have a progam called IconArt that would create icons that looked like icons when I used them in VS. IconArt is now abandonware and won't run on my 64bit Windows workstation.
Since I didn't get any answers within the time I was hoping, I posted this question also in the MSDN Visual Studio forum, and got a good answer that I thought I should post here. Credit to Reed Copsey, Jr, for the answer!
This is it:
You'll need to put your design in all of the different versions. ICO
files contain multiple versions of the same image, for different
screen resolutions.
My personal preference is to not use VS - there's an ICO plugin for
Paint.Net (all free) which allows you to make a single image
(typically 256x256), and save multiple versions within an ICO file in
one shot. It's very useful for building icons.
See
http://forums.getpaint.net/index.php?/topic/927-icon-cursor-and-animated-cursor-format-v37-may-2010/
for the plugin.
Since I am a Paint.Net user, the plugin sounded like a great idea, and I tried it. Bingo! This works very nicely.
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.)
I want my WP7 app controls and to have a certain font which is not in Visual studio font selection, how can I add the font to the font list of Visual studio or directly into my controls?
This can be easily done using Expression Blend.
In your project, select a TextBlock and go to the Properties panel, under Text section, there is a Font Manager button (see below), click it and then you can select the font you want in a popup window.
Expression Blend will automatically create a Fonts folder and put all the embedded fonts in there, really easy to use. :)
Here's a post showing how to embed fonts in a silverlight project (see the section 'Custom Fonts'):
http://blogs.silverlight.net/blogs/msnow/archive/2009/09/09/97060.aspx
I haven't tested this in a windows phone project but it should work.
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.