Click here to Skip to main content
15,890,527 members
Everything / Font

Font

font

Great Reads

by Iman Abdollahzadeh
TrueType implementation from scratch
by Marco Bertschi
A short description of the Code 39 Barcode font by Matthew Welch (and how to use it)
by VyReN
Using VB.NET's RichTextBox and fitting all text into the box
by ASP.NET Community
In this post you will see how can we change the font size on the fly. Style.css.bodyContent14{FONT-SIZE: 13px; LINE-HEIGHT: 14px}

Latest Articles

by Mohammad Elsheimy
Porting Windows Fonts to Linux
by ToughDev
How to interface Nokia 3510i and 5110 LCD with PIC Microcontroller
by ToughDev
Experiment with ST7920 128×64 graphical LCD on PIC
by Iman Abdollahzadeh
TrueType implementation from scratch

All Articles

Sort by Score

Font 

8 Jan 2021 by Iman Abdollahzadeh
TrueType implementation from scratch
21 Apr 2014 by Marco Bertschi
A short description of the Code 39 Barcode font by Matthew Welch (and how to use it)
19 Dec 2010 by VyReN
Using VB.NET's RichTextBox and fitting all text into the box
10 Dec 2011 by Manoj K Bhoir
Try this code it's 100% working :)RichTextBox1.Font = New Font(RichTextBox1.Font.FontFamily, RichTextBox1.Font.Size + 1, RichTextBox1.Font.Style)I hope it will solve your Problem.
7 Feb 2011 by Mick Leong
I have an application that requires display of Chinese characters (preferably Unicode). In In VS2008 C++ Pro I can filter the enumerated fonts via font signature:int CALLBACK MyApp::EnumFontCallback(...){ENUMLOGFONTEX *lpelfe;NEWTEXTMETRICEX *lpntme;int nSimpCh =...
13 Jan 2012 by Richard MacCutchan
You are using the wrong value to create the new font, you should be using the SelectionFont.Size like this: fontsize = richTextBox1.SelectionFont.Size + 1;
7 Dec 2010 by VyReN
Got it! Kschuler, you pointed me in the right direction!Here is a quick sloppy sample I created, when the Button is clicked, the Rich Text Box is adjusted to fill the entire box.Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As IntPtr, ByVal nIndex...
6 Dec 2010 by Kschuler
I've never done exactly what you are requesting, but I wanted to point out the ZoomFactor[^] property of the RichTextBox. Perhaps that can be used. And I vaguely remember something about being able to determine if scrollbars are needed in a textbox...I had trouble finding it again though...and...
7 Mar 2011 by Sergey Alexandrovich Kryukov
Just a note for you: there is no such thing as "Hindi font". There is Devanagari script used not just in Hindi but in a good number of other most used languages in India and — importantly — in Sansrit. Now, there are no "English" or "Latin" or "Arabic" or "Devanagari" fonts. The...
1 Sep 2014 by Sergey Alexandrovich Kryukov
Andrey Bushman asked:But what about BIOS? It works before the OS and displays the text too. BIOS knows nothing about the GDI, as I understand. And... How GDI does it?BIOS has its own fonts. More exactly, the portion of the BIOS stored in each graphics card. The fonts can be modified by filling...
14 Aug 2017 by BillWoodruff
I've used this in the past; it handles the case of all-selected in the same way as none-selected. And, you can, optionally, reset the selection after the Font change. private void SetFont(RichTextBox rtbx, bool restoreselection = false) { int selStart = rtbx.SelectionStart; int selLength...
26 May 2010 by Dalek Dave
I wish to present a web page in a specific font.However, most people will not have this font, so is it possible to, for the want of a better word, 'Impose' this font.I am thinking it may be necessary to put the font on the server and somehow point to it from within the page, perhaps some...
26 May 2010 by Pete O'Hanlon
There are a few ways to do this. The first way (and the way that's recommended) is to use font fallbacks and degrade nicely. The second way is to use Flash to display the font (there are a few examples of this on the web). The third way is to use an embedded font referenced from a stylesheet....
26 May 2010 by CPallini
Let Me Google That For You [^].kidding, Dave, kidding...
22 Jul 2010 by Galatei
Hi,Sorry for stupid question, but have you actually initialized 'pfc' ?Also, make sure to call SetCompatibleTextRenderingDefault(true); or override UseCompatibleTextRendering property in your control and return true.One last thing that comes to my mind is the font itself: does it exist...
12 Aug 2010 by Emmery Chrisco
I am trying to save the last used font, font color, and background color. Then when starting myapp up again, read the data and use the last used settings. Make since?Here is what I have so far:User pick new font &/or colorIf FontDialog1.ShowDialog() Windows.Forms.DialogResult.Cancel...
17 Aug 2010 by TheyCallMeMrJames
FontStyle is marked with FlagsAttribute.This means you can 'or' them together.private FontStyle GetCellStyle(object yourOptions){ FontStyle style = FontStyle.Regular; style = yourOptions.IsBold ? style | FontStyle.Bold : style | FontStyle.Regular; style =...
28 Dec 2010 by Dr.Walt Fair, PE
The means to increase the text size depends on your browser. For IE it's under View | Text Size on the menu. For FF it's View | Zoom, etc. In most browsers you can also use Ctrl + the mouse wheel, as mentioned.
27 Jan 2011 by Sergey Alexandrovich Kryukov
You already have it. Any font which supports Unicode will be supported in the same way in all similar applications, as well as in your regular and rich text boxes, labels and text boxes.If you're interested in a font which would support the most rich set of different Unicode sub-ranges, you...
7 Feb 2011 by Sergey Alexandrovich Kryukov
These days, Chinese is supported almost exclusively in Unicode (everything else must die). And most font support both scripts (simplified and traditional). However, this Question makes perfect sense.The solution is explained here:...
29 Mar 2011 by Sergey Alexandrovich Kryukov
Color is not a property of the font (even though some UI may show selection of the text color under the "font" property; this is done just for convenience). Color is the attribute of the element of structure of the structured document or a style of such document, such as whole document,...
5 May 2011 by Keith Barrow
HTML 4 Depricated this tag, you should get rid of it. The World Wide Web Consortium (W3C, the people responsible for the HTML standard) admit that they got HTML3 badly wrong when it comes to styling.Refs:http://www.w3schools.com/html/html_styles.asp[^]and...
5 May 2011 by Manfred Rudolf Bihy
Read here (an excellent source BTW) http://www.w3schools.com/tags/tag_FONT.asp[^] and they will tell you that the font tag is deprecated. They continue with saying to use CSS[^] instead to do the styling.Best Regards,-MRB
4 Dec 2011 by Manoj K Bhoir
Exactly as LanFanNinja said in above comment you are passing String Value where you have to pass Single.I think you are using Vb.Net languge The syntax to Set Font for RichTextBox is as follows :RichTextBox1.SelectionFont = New Font("Tahoma", 12, FontStyle.Bold)You change your code and...
7 Jan 2012 by Drazen Pupovac
FontStyle is enum and therefore you can set multiple styles by |, like this:textBox1.Font = new Font(textBox1.Font, FontStyle.Bold | FontStyle.Underline);
16 Mar 2012 by Hossein_Hadi
Hello everyone,Please help me that how can I understand the font that a character is written with in a PDF file.Any library , algorithm, link and so on?Thanks for suggestion.
1 Jun 2012 by Tim Corey
From what I can see, that might be a problem. The GS1-128 (formerly UCC/EAN 128) isn't compatible with web-based products if you are attempting the ASCII method. However, for details on how to work with this font, this FAQ should provide some...
20 Aug 2012 by Christian Graus
The graphics classes won't take rich text. You need to position the bold words yourself and make them bold. You can use Graphics.MeasureString to work out where one word ends to put the next one in bold.
15 Sep 2012 by Adam David Hill
Just a quick off-the-cuff idea, but have you tried just wrapping a TextBlock inside a ViewBox? I don't have access to VS at the moment to try, but I imagine that would scale it automatically for you with essentially no special code.Apologies if I've missed something.
15 Sep 2012 by Kenneth Haugland
Can you use this:TextBox myText = new TextBox();Rect textRext = myText.GetRectFromCharacterIndex(myText.Text.Length);http://blogs.microsoft.co.il/blogs/tamir/archive/2007/03/12/Text-length-measurement_3F00_-It_2700_s-really-easy-with-WPF.aspx[^]
2 Dec 2012 by Joneeky
An object will be destoried after it works down. So you should use a point of object.CFont *m_pFont = new CFont;m_pFont->CreateFont(...);myEdit->SetFont(m_pFont);
1 Apr 2013 by vinodkumarnie
There are many ways to do this..1. Use Font-Size attributeor
23 Jun 2013 by TorstenH.
Is that a calculator?Please use Gridlayout for that - the Flowlayout will change when you resize the Window.A Visual Guide to Layout Managers[^] @ oracle.comI'd also recommend to OOP the returning code for the buttons - make a function that you pass the label text as an argument....
26 Aug 2013 by Sergey Alexandrovich Kryukov
Please see my comment to the question. Even if you implement the behavior you want (which is itself surprisingly difficult, because of font hinting), you may run into a very unpleasant stylistic clash with other elements of your UI.Rather, you should review your UI design.—SA
26 Aug 2013 by Dave Kreskowiak
So you want the font to resize itself to fit the string in a label?? The method doesn't exist. You'll have to code this up yourself.I did this (a long time ago!) by creating my own control, inherited from Panel, not Label, and drawing the text myself.You'll need to use MeasureString[^]...
24 Sep 2013 by Sergey Alexandrovich Kryukov
Makzrider wroteit is not showing that h1 tag in my asp.net pageThis concern has nothing to do with CSS and fonts you mentioned in your question title. The tag can be shown only if you write it in HTML:Some Top-Level Header TextBesides, this is a really bad idea (in...
1 Oct 2013 by ajirahman
Can you help me to create a pdf/A-3 with an embedded xml file with itextsharp . I am trying to create but got error "All the fonts must be embedded. This one isn't: Helvetica"The sample code I have provided hereusing iTextSharp.text.pdf;using iTextSharp.text;private void...
16 Jul 2014 by Richard MacCutchan
Use the EnumFonts[^] function to check if the fontname is valid.
1 Sep 2014 by CPallini
According to this page[^], at lest on system having the Windows NT architecture, fonts are handled by the GDI, in the kernel.
2 Sep 2014 by Member 10996886
ummm ..........................................................................................
30 Dec 2014 by Snesh Prajapati
There is a blog post at below link discussing similar issue:http://blogs.msdn.com/b/ploeh/archive/2006/08/10/howtodisposemembersfromforms.aspx[^]It describes how to dispose Members From Forms. In the comments section of that post Author has provided below code with explanation.public...
30 Jun 2015 by OriginalGriff
The first thing to do is check the return value.The documentation[^] says: If the function succeeds, the return value specifies the number of fonts added.If the function fails, the return value is zero. No extended error information is available.So start by looking to see if it returns...
7 Jan 2016 by Richard MacCutchan
You can often find the answer just by reading the documentation for the class you are using: Clipboard.SetText Method (String, TextDataFormat) (System.Windows.Forms)[^].
11 Jan 2016 by Sergey Alexandrovich Kryukov
I really sympathize with your efforts; you are trying to study despite of pretty difficult situation and tough schedules.I would like to give you just a few ideas.First of all, you can do a lot of development and study without your own Web site. As you mentioned "go to back end and upload...
3 Aug 2016 by Stephen Soper
I got this working without using a panel, just a label. I call this code when the text changes or the size of the label changes (I have it set to anchor on all sides). In my case, the text is simply a number that changes every second for near real time visual updates. I hope this helps the...
3 Sep 2016 by BillWoodruff
You can set the (entire) Row BackColor or ForeColor directly:YourRow.DefaultCellStyle.ForeColor = Color.Red;You can set a particular Cell's colors by:YourCell.Style.ForeColor = Color.Red;This thread on StackOverFlow contains a number of valuable examples of working with DataGridView Color...
14 Aug 2017 by Leo Chapiro
You can select all the text before changing SelectedFont: rtbText.SelectAll(); rtbText.SelectionFont = fontDialog1.Font;
22 Jan 2018 by OriginalGriff
Some Email systems do allow for web fonts by embedding the font directly in the HTML: The Ultimate Guide to Web Fonts in Email—Litmus Software, Inc.[^]
16 May 2019 by RickZeeland
Maybe these will get you started: Character Map in WPF[^] GitHub - SixLabors/Fonts: Font loading and drawing library.[^]
17 Mar 2020 by Member 13225610
For all those who are facing the same issue, posting the link from where I got the solution - Installing Fonts Without Registering Them in the R... - Community[^]
13 Sep 2021 by Richard Deeming
The AddFontFile method expects the path of a physical file on disk. You cannot pass in a pack: URI, because it doesn't understand that format. And you cannot just call .ToString() on a Stream, since that won't produce any meaningful information. ...
22 Jul 2010 by gwithey
Hi,I have come across a strange issue whilst embedding a font into a custom user control. This is the code i used to store the font in order to use it again at runtime. private PrivateFontCollection pfc; // Stores the font used by the control private void...
26 Jul 2010 by freemanirl
So, I've wrote a program awhile ago that prints barcode labels. The old version needed the font to be installed in the fonts folder, but that made it a pain for people using the program for the first time, as the program would print the barcode label with a default font. If I load the font...
26 Jul 2010 by E.F. Nijboer
I guess "FRE3OF9X.TTF" isn't a valid font family. Look at the msdn example below.http://msdn.microsoft.com/en-us/library/y505zzfw.aspx[^]Good luck!
12 Aug 2010 by AspDotNetDev
You have to use the Font constructor to create a font from a string. That would look something like this:MainText.Font = New System.Drawing.Font(New System.Drawing.FontFamily("Arial"), 20)
17 Aug 2010 by Ticardiff
Hi everyone.I'm brand new to programming as I have started 4 weeks ago.I'm creating a spreadsheet software similar to Excel.My problem is the following.When the personne who will be using my software is clicking on a celland then changing the style of the font by pressing some...
4 Oct 2010 by daniharTech
Hi, does anybody know how to create custom fonts within a .NET application? I have a project for which I need to create custom fonts within the main application. Are there any plug-in/COMs about? Or maybe any command line tools out there that can take a bitmap and insert it into a FON file at a...
4 Oct 2010 by Abhinav S
WPF now provides something[^]. They call it a composite font but its kind of includes your own customizations.
4 Dec 2010 by VyReN
Greetings -- Have been looking around for an answer for a long time without luck. VB.NET 2010 - I am looking to take a string from a database (No newlines, but may in the future) and display the text in a multiline textbox with wordwrapping and have the text's font size adjust to ensure all...
27 Jan 2011 by kokobu
hey i have vb.net application that could write some languege in a diffrent way ( unicode ....) but i need to make it general .means could write to any windows text like microsoft word,note pad... so can any body help me with this
8 Feb 2011 by Mick Leong
SAKryukovM...
2 Apr 2016 by Katiyar S.
Hello Experts.I want to use hindi font in some of my Pages on a ASP.NET Site. I have that font on my machine. that may not be available in general. how can i pack my font with the website, so that any user who uses the site sees the text in same font. even if i define that font for any...
29 Mar 2011 by GeorgeVN
Is it possible to change the font or font color of a file name[in VC6]?The file is of type txt/xls/doc. The OS is Windows XP SP3.Thanks in Advance.
17 Apr 2011 by CDP1802
There is a little more to alpha blending than just setting the alpha values in some color values. The unexplained behavior you described may be the result of using another blending strategy (the default of the graphics device) than you expect. I don't usually have much to do with this in...
5 May 2011 by hiseshu
no need to give the font tag instead of that u can use the style propetyHappy Codding..:)Seshu
3 Jun 2011 by Anshul R
Use WPF. Set ForeColor Property.
8 Jun 2011 by ArtificerGM
RichTextBox Class... Problem solved!C# - Formatting Text in a RichTextBox by Parsing the Rich Text Format (RTF)[^]http://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.aspx[^]
24 Jul 2011 by thatraja
Hope these will help youFont size problem in exporting Crystal Report to PDF using ASP.Net[^]Font Size Decreases When Export to PDF in Crystal Report[^]
14 Nov 2011 by OriginalGriff
From the sound of it, you intended this as a comment or reply to either an existing question, or a forum message.If so, please try to use the appropriate facilities (use the "Reply" or "Question or Comment" buttons instead of "Ask a Question")
13 Dec 2011 by Reader Man San
From the bellow links, to make Crystal Reports v13 or CRVS2010 for VS 2010 that exports correct pdf font size:Add two DWORD keys and set their values as 1:HKEY_CURRENT_USER\Software\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal...
4 Oct 2016 by Lijo Sebastian
Hi friends, Please help me to provide a good solution for this. How to install a font permanently in your system programmatically, using C#. I want the font immediately available in Windows Fonts folder, without system reboot. I googled a lot, but no luck. I found AddFontResource...
21 Dec 2011 by Rajesh Anuhya
Are you tried this??Here[^]
31 Dec 2011 by Mathsquare
RichTextBox1.F...
31 Dec 2011 by Sergey Alexandrovich Kryukov
It may mean only one thing: at the moment of call, your selection could be not what you expected. Look where your SelectionStart, SelectionLength are.—SA
8 Jan 2012 by BillWoodruff
1. Assuming that you are now using a TextBox: all changes to any TextBox Font property will set the font-styles, size, etc., for ALL content. If that's what you want, you may want to skip the rest of this comment :) ... edit : removed incorrect content: properties of a Font of a Control,...
28 Feb 2012 by Maximilien
Howdy'We are using a specialized font for our application (for GD&T notations).When rendering the text using OpenGL the font is not displayed properly (compared to GDI or even inside Word), there are some additional spaces (1, 2 pixels ) between characters of the rendered string.Code...
28 Feb 2012 by JackDingler
I've never liked the way that bitmapped fonts show up in OpenGL.In my last project, I had wanted to to try to implement the meshes created by D3DXCreateText(). I never got a chance to give that a go.You can find it in the DirectX Samples.It looks like a good solution for the windows...
28 Feb 2012 by JackDingler
Another possibility is the Free Type library.
28 Feb 2012 by jk chan
You can create meshes for the desired font in 3d max or google sketch up(free), and save it in 3ds or obj format, read it from your application.. Render it.. straightforward right ?jkchanhttp://cgmath.blogspot.com
31 May 2012 by MichaelaWa
I need to be able to generate UCC/EAN 128 barcodes with our ActionScript-based application. A already have the Code 128 font integrated, but need to create UCC/EAN 128 barcodes. Browsing information from Google, I found that the UCC/EAN 128 is actually a subversion of Code 128, so it hasn't got...
4 Jul 2012 by Member 4311057
Problem solved.when creating a label via code the "AutoSize" properties is set to false.To avoid the crop problem,after initializing this line have to be added:label.AutoSize = true;
6 Aug 2012 by MR. AngelMendez
Hi, I am making an APA web based citation generator. All is well but I seem to be having trouble making a string have an Italic font, Here is my code.using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using...
6 Aug 2012 by Abhinav S
You need to change the box's font style.http://www.java2s.com/Code/CSharp/GUI-Windows-Form/RichTextBoxFontbolditalic.htm[^] might help.how to change a textbox text to bold,italic in C# windows application[^] is for a normal textbox, but might give you an idea as well.
7 Aug 2012 by MR. AngelMendez
Hey Abhinav S, I found what I was looking for thanks for your help. I came across this post on "StackOverFlow" heres the link. You can find the solution from the user called "PsychoDad"http://stackoverflow.com/questions/956490/search-a-sentence-in-a-string-c[^]
16 Aug 2012 by Kenneth Haugland
I have read the documentation from Microsoft and it does not say anything about FontSize limit. Pasted the liks below as references:http://msdn.microsoft.com/en-us/library/office/aa200988%28v=office.10%29.aspx[^]http://msdn.microsoft.com/en-us/library/cc189010%28v=vs.95%29.aspx[^]My...
18 Aug 2012 by Lee Reid
I eventually solved this issue by specifying the textformattingmode to be display.
20 Aug 2012 by F.moghaddampoor
i want to draw a sting like my name is Tom and people love me in an image.but i don't know how, can anyone help me. i want to copy a formatted long text in a richtext box and after that write it on an image.so i need to align that in a rectangle.do anyone know the simple way to do this?my...
2 Nov 2012 by Sharath2790
My application has two forms(form1,form2).. Form1 has 3 labels. form2 has 2 comboboxes(combobox1,combobox2) and save button. combobox1 is for list of fonts and combobox2 for list of fontsizes. After selecting required font.. How do i assign it to the labels in the form1...???
2 Nov 2012 by sarathtamil
Use This code..In form2,at save button click..Session["listoffonts"]=combobox1.SelectedValue.ToString();Session["listoffontsize"]=combobox2.SelectedValue.ToString();In Form1 Page_loadlabel1.Text=Session["listoffonts"].ToString();label2.Text=Session["listoffontsize"].ToString();
2 Nov 2012 by Gautam Raithatha
first in Form1.Designer.cs, make all three labels declarations as "public".in Form2 if from Combbox font selected is "Calibri", then on Save click, write below code. Jst replace "Calibri" with whichever font selected.Font objFont = new Font("Calibri", 9, FontStyle.Bold);Form1 objForm1...
2 Nov 2012 by Aarti Meswania
I am vb.net developer not so fluent in C#sorry if any mistake in code-blocks,but process should like below...,create a class LookNFeelcreate static 'NewFont' variable so, that in your application it can work as global variable... and you can retrieve it in other forms...
8 Nov 2012 by Steve RG
My C# application includes simple text boxes and richtext boxes. Often the richtext boxes contain rich text copied and pasted from elsewhere, and often the rtf markup includes hardcoded font size (\fsXX, XX in half points). In most cases the font size of the rich text is the same or close to...
20 Nov 2012 by Omkaara
i have two comboboxes combobox1 & combobox2 i am getting all system fonts in combobox1 i need to get fontstyles of a select font in combobox2 Dim fc As New Drawing.Text.InstalledFontCollection Dim ff As FontFamily() = fc.Families() For Each family As FontFamily In ff ...
20 Nov 2012 by Krunal Rohit
this might help you:http://stackoverflow.com/questions/5659610/re-how-to-get-font-name-and-its-own-styles[^]
20 Nov 2012 by Alan N
I think the way to do this to test each of the styles Regular, Bold, Italic and Bold|Italic with the FontFamily.IsStyleAvailable[^] method.I have also seen (Book, Programming Microsoft Windows Forms, Charles Petzold, Microsoft Press, 2006) trial creation of a font in each style with...
2 Dec 2012 by d rasool
hi.first of all sorry for my bad english.im trying to change font of a CEdit Control using of Setfont() function but its not working for me here is my code:void CCustomView::OnInitialUpdate(){CView::OnInitialUpdate();CFont...
5 Dec 2012 by Deepak_Sharma_
Hi,Can we show/hide installed fonts in Windows OS using C# in Windows FormsIs there any class through which we can access a font say "Arial" and hide/show it.We can manually show/hide a font by right click on the font in the Windows fonts folder
18 Dec 2012 by Dr. GUI
I don't know if I understand your question right.If you just want to get the installed fonts, there is a class "InstalledFontCollection" derieved from "FontCollection"string familyName;string familyList = "";FontFamily[] fontFamilies;InstalledFontCollection installedFontCollection...
12 Jan 2013 by navidsoft
Hello every body I cunstructed an EDITOR seems to windows Notepade for my software to bring out special informations and show them to the user. the user has ability to make some changes like Font size change or bold some where in text by the editor and save in SQL and then print the text...