Reading Shx Font File (cad Font)
hi shx font file contains some shape of characters with a unicode for each one. know i need to read unicode of each character in shx file from vb . help me please...thanx.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Font File Name From Font Face Name.
Hi Visual Basic programmers.
I have written an ActiveX component to replace Microsofts CommonDialog1 to select a font and/or colour.
I started this back on 6/09/2002, but now wish to add a 'font information' window to display;
Font face name, file path name, family name, font copyright etc.
My question is how to get the full font file pathname from a font face name.
Eg. 'Arial' = 'C:WINDOWSFontsARIAL.TTF'
I can't use FileName$ = "C:WindowsFONTS" + FontFaceName$ + ".ttf"
as not all font files can and/or do have the same name as the font face name.
I have used "HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerShell FoldersFonts"
and "HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionFonts" + FontFaceName$
to get the font directory and file name. But this dosn't work with all fonts.
Dim FontDir As String
Dim FontFile As String
Call modRegistry.fReadValue("HKEY_CURRENT_USER", "SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders", "Fonts", "S", "C:WindowsFonts", FontDir)
Call modRegistry.fReadValue("HKEY_LOCAL_MACHINE", "SOFTWAREMicrosoftWindowsCurrentVersionFonts", FontFaceName$, "S", "", FontFile)
' Not found so use 'FontFaceName$ + " (TrueType)"'
If FontFileName = "" Then
Call modRegistry.fReadValue("HKEY_LOCAL_MACHINE", "SOFTWAREMicrosoftWindowsCurrentVersionFonts", FontFaceName$ + " (TrueType)", "S", "", FontFileName)
' Not found so use 'FontFaceName$ + " Bold (TrueType)"'
If FontFileName = "" Then
Call modRegistry.fReadValue("HKEY_LOCAL_MACHINE", "SOFTWAREMicrosoftWindowsCurrentVersionFonts", FontFaceName$ + " Bold (TrueType)", "S", "", FontFileName)
' Not found so use ...
If FontFileName = "" Then
Call modRegistry.fReadValue(...
' If path in FontFile then don't use FontDir (C:WINDOWSFonts)
If InStr(FontFile, "") > 0 Then
FontDir = ""
Else
FontDir = FontDir + ""
End If
FontFile = FontDir + FontFile
Detecting The Current Font And Font Size On Various Lines In A Rich Text Box.
I have written an editor that uses a rich text box as the main text area.
The editor allows the user to select a font and font size on the toolbar.
My question is, how does one get the combo box text (for both the font and font size) to display the font or font size for the current line of the current character location?
Meaning, if I were to type in two lines, the first line being Arial 12pt, and the second line being Tahoma 14pt, how would I get the program to display the font and font size in the combo boxes?
I know about SelFont, SelStart and such, but I am not selecting any text. I am merely moving the cursor up or down and need to be able to display the font and font size for where the cursor currently is.
Anyone have any ideas?
I thank you in advance.
Detecting Font And Font Size On Various Lines In A Rich Text Box.
I have written a basic editor that uses fonts and such, however when I select a different line (while entering text into the text area of the rich text box), it doesn't display the font or font size for that particular location.
Does anyone have any ideas where I can look to solve this problem?
I thank you in advance for any information you may be able to share with me.
How To Save Text Fontsize, Font Style And Font Color
When I save the text in a Richtextbox to a Access Database, How to save the font style and Font color with the text (Assume that user can change font style and color when they typing text into the richtextbox).
Then when I load the text from Access Database back to the Richtextbox, it should associate with it's font style and color when I was saved.
How to realize these functions???
Thanks in advance
How To Get The Font Name And Font Size Of Header/footer Text?
Hi Everybody
Simple question.
In one of my procedures, I write the VBA Excel code set the text for headers and footer specifying the font name and font size (code line shown below in part).
Code:
'...
'...
'worksheetName has been previously defined to contain the
'name of the worksheet being handled
fullFilename = ActiveWorkbook.FullName
footerText = fullFilename & "[" & worksheetName & "]"
With ActiveSheet.PageSetup
.LeftFooter = "&""Times New Roman,Regular""&06" & footerText
End With
'...
'...
However, when I try to read the same (header/footer text) using code and assign it to a string variable, it actually includes the VBA code referring to the font name and font size as well. This is what I get (the contents of the string variable is shown below).
&"Times New Roman,Regular"&06H:MSOFFICEMY DOCUMENTSCombined National Monthly ReportTest11.xls[SBU - East]
Have a look at all the text prior to "H:..."
But when you see the header/footer content in pagesetup -> headers/footers, you only see the actual text viz :-
"H:MSOFFICEMY DOCUMENTSCombined National Monthly ReportTest11.xls[SBU - East]"
Is there a way to read this actual text only in to a string variable?
Best regards
Deepak Agarwal
Retain Font Styles When Changing Font Size
March 25, 2008
Re: VB6
Hello, everyone. I searched for over two hours for an answer but didn't find a relevant forum example. I am using a richtextbox for my documentation. I made several simple font features such as font sizes and font styles (bold and underline) to the richtextbox. The problem I have is that after I bolded and underlined some of my document text, if I change my document to a different font size, any text that have been bolded or underlined will be undone, so I have to highlight them and bold or underline them again. Does anyone have any advice or any example code to correct it?
The following is a fragment of code in selecting for fontbold and for changing font size:
If Len(Trim(RichTextBox1.SelText)) > 0 Then' For selecting text
RichTextBox1.SelFontSize = 14
End If
RichTextBox1.SelBold = Not (RichTextBox1.SelBold)' For selecting text for bold
RichTextBox1.Font.Size = 14 ' Font size to the whole document or richtextbox
Any advice or help will be greatly appreciated.
Mydanvue
Load Font Sizes Depending On Selected Font
I have lokked and looked for thi sbut cant find anything about it. I want to be able to select a font from a combo box and have the correct font size apper within another combo box to choose from. How do I go about loading the proper font sizes for the fonts.
How To Change The Font Type And Font Size For A Menu Bar?
Dear all,
I meet a problem in my application. How can i change the font type and font size for the menu used in th form? Since my application is run on 1280x1024, it is too small to see the type on the menu bar. Could anyone help me? Very urgent!!! Thanks.
Paul
Reading In A Font?
I am trying to do the following:
1. A user types in a text box a string "Hello"
2. They choose a Font (Arial, Times, etc)
3. They click "Go" for lack of a better term
Now is the hard part, I want to read the text string that they typed in and create an image using whatever font they selected. Basically it will check the encoded version of each character the user typed in and match it to the character in the font. Any ideas of any way to read in a Font and output an Image from that font?
Any help is appreciated...
Thanks.
Changing Default DC Font To MsFlexGrid.Font.Name
When I need to obtain a font LONG value for a command button, I make the following:
ButtonFont = SendMessage(Command1.hWnd, WM_GETFONT, 0&, 0&)
I need to do the same for a MsFlexGrid and the function returns 0.
In this case, and because I need to change de default Device Context font (SYSTEM) to the MsFlexGrid.Font.Name, I'm unable to change it.
How can this question be solved ?
Thanks in advance
CommonDialog Box Font Box - Font Doesn't Change
Hi,
I'm using the ShowFont feature of CommonDialog in VB 6.
I have a Rich text box called RTB1
With comDlg1
.DialogTitle = "Font" 'set the dialog title
.Flags = cdlCFBoth
.ShowFont
End With
RTB1.SelFontName = comDlg1.FontName
RTB1.SelFontSize = comDlg1.FontSize
RTB1.SelBold = comDlg1.FontBold
RTB1.SelItalic = comDlg1.FontItalic
RTB1.SelStrikeThru = comDlg1.FontStrikethru
RTB1.SelUnderline = comDlg1.FontUnderline
When I select a font from the box and hit ok - I don't see the font change in the Rich Text Box (for e.g, the font size) .. I step through the code and the .SetFontName , .SelFontSize etc properties of the Rich Text box are getting set from comDlg1 ... but there're no visible changes to the font..
Appreciate any help - thanks.
Saad
FrmMain.Font = (How I Can Load A Font From Resource) ?
Is it possible to load a font in my form from a resource file...?
I made a search in the vb-forums but i only found that you can load a font from a file...
Can anybody help me out...?
This is the link to load a font from file:
http://www.vb-forums.com/showthread....=font+resource
Font Icons (like In The Change Font Dialog)
Ok, im loading fonts into a combobox (ComboBoxEx) - And I want to add the proper icon next to each font if they have one, like it is in the Change Font system dialog.
Im using the character set value right now but by comparing my results to the change font dialog, I dont think thats close to right, or im just not doing it right.
Can someone show me how to determine what icon (if any) goes to a particular font?
Changing Font Size And Bold And Font ???
dim Heading as string
Heading = "I want to Make this sentance Bold and bigger"
how would i go about making this variable bold and changing the font and font size.
thankyou
Checking Available Font Sizes For A Given Font
In my program I want to change the Font often on different controls so I have opted for the word-processor approach rather than popping up the dialogFont each time.
I have the Buttons for Bold, Italic, Alignment and a Font Name picker. This all works fine.
Is there a way for me to find out what point sizes are available for a selected Font so that I can place these in a dropdown list as well ?
I can work around this by starting the fontsize at 6 and adding .5 continually upto 40 and checking which unique values are returned but It would be nice to do it with a cleaner method.
Code:
Dim wFontSizes(200) As String
'txtFontTest is an invisible Text Box
For i = 0 To Screen.FontCount - 1
a = ""
cbFont.AddItem Screen.Fonts(i)
For j = 6 To 40 Step 0.5
txtFontTest.FontSize = j
If txtFontTest.FontSize <> b Then a = a & " " & Str(j)
b = txtFontTest.FontSize
Next j
wFontSizes(cbFont.ListCount - 1) = a
Next i
Many thanks
I'm just going to populate my list with these sizes for each font - as per VB and MS Word - gives me a decent selection.
8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 40, 48, 72
Thanks for the replies.
Font Type & Font Size
Hi,
I was wondering what font type and font size you usually use in your vb projects.
What font size is too small, and what size is too big?
Do you use different fonts in your project? or maybe different font sizes?
As you noticed my question is some kind of a poll, I hope there will be much replies.
Thank you for your time!
OsMo
Getting Standard Font Sizes For A Font
I was wondering if anyone knew how to get all of the standard listed font sizes for a specific font name.
For example:
In the font common dialog, when you click on certain font names, the list of available font sizes changes.
Say I click on MS Sans Serif. The font sizes that are listed are 8, 10, 12, 14, 18 and 24.
If I click on Courier, I get 8, 10, 12 and 15.
I'd like to know if anyone has a clue how the commondialog gets this info, and where to get it?
Thanks!
Imp
Web Font Question: Font Size
has anyone by chance tried to figure out a way to convert font point size to html size?
Like FontSize @ 8 = HTML font size 1???
Thanks!
(I have figured out how to change web page settings on the fly...BG color...text color...link color...ONLY for less complex pages)
Large Font Or Small Font
there is a strange problem with VB. Applications created in VB wont run properly if the syste font setting is Large font. How do I find out during run that whether the system has small font setting or large font setting. thanks
Change Font With Printer.Font.Name
I am using:
Printer.Font.Name = "Courier"
Printer.Font.Size = 8
Printer.Print txtData.Text
Printer.EndDoc
Because txtData contains columns of text and/or numbers, I do not want to use a variable width font.
Both the Form and Textbox fonts are set to Courier.
But the code above does not actually change the font to Courier on the printer.
I know this is an old problem, but I can't find the solution on Tek-Tips or anywhere on the net.
I have seen that some programmers use Doevents after setting the new font, or use Printer.Print "" before printing the data.
Neither of these work for me.
In another program I am using Printer.Font.Name = "QuickType Mono"
and that works. But it doesn't work in this program.
Can someone explain this?
Font Size Vs Font Selected?
I'm creating the editing toolbar for a Rich Text Box, and am starting work on the Font selector (combo) & Font Size selector (combo) and was wondering: Is the size dependant on the font chosen or can the font be any size the user chooses?
|
+--JDMils
|
+--VB6
+--VB Dot Net
|
+-- Navman GPS Forums @ http://forum.jdmils.com
|
Small Font Vs Large Font
Why does my application that uses custom shaped windows, look so strange when large fonts is used in Windows? Is there a way to have the graphics align properly no matter if it is small or large fonts?
&"new Font&" Properties Cancel Previous Font Property
Hi , I am a super newbie with an issue.
I hope I explain this well enough to make sense.
I have a form with multiple check boxes that adjust font properties. I have a bold chkbx, an italic chkbx and an underline chkbx. I have coded them individially to change the font property in a rich text box using "new font =" with the "_click" sub. They all work properly by themselves, but if another chkbx is selected, the new chkbx font cancels the old font.
What I want to happen is for the font properties to accumulate, meaning that I want bold and italic and underline to all be displayed when all three chkboxes are checked.
I can't seem to figure out how to put multiple FontStyles.(bold,italic,underline) in a single command.
thanks for bearing with me and any advice would be appreciated
Zeke
Printer Font Size Vs Picturebox/form/font Size
HI Everibody.
Sorry for my bad English
Why the printer object font size is different as in Picturebox or form font size property?
I copyied in a PictureBox all the properties availabe in the printer object (width, height, scalemode, scalewidth, etc, etc) to simulate a printer object, but the font size in the picturebox is always greater therefore printer.currentX & Y does not match picture1.currentX & Y
Now, how can I configure a picturebox that matches perfectly the printer proportion? I need it to make Preview routine
How can I caculate the correct scale for Picture1?
Font And Font-weight Changes By Itself
Hi,
I notice that VB make changes to my fonts previously whenever I make some codes changes to a .frm file. This I found out to be because some fonts specified by the codes were not found on the system as I've just took over this codes and is using a different platform (WinXP) from my predecessor (using Win2000). I've copy all the fonts files and this problem is solved.
After that I notice VB always make changes to codes automatically (for the gui protion) like rearranging the codes as long as I've view that form even without making changes.
Initially I thought rearranging should not be a problem but I later find out that some font-weights were also being changed too.
This create problems as its pretty hard for me to compare the changes as the sequence of the codes for GUI keeps changing. I couldn't know what has been changed but I need to save the codes when I make some change to the flow!
Does anyone here knows why this is happening?
Is there any good solution to this?
The gui changes without my attention and could be disastrous for me.
Hope to receive some much needed advice.
Thanks.
Learner
Font Name And Font Size
How Do I change the .FontSize and .FontName properties of Printer object from VB 5.0. I'm using an Generic Text Only driver for an Epson TMU-200.
Thanks....
Font From File?
Is there any way to make directx load a font from file(font file, not the texture)?
Which Font File Is Being Used
I know the code for finding out the system fonts directory, but how do I know what font file is being used by for example a particular label.
If I set the font of a label to Arial, it used the file Arial.ttf, but if I'm using Arial and have it set as bold the file used is Arialbd.ttf. Windows just does this automatically, but how does it know which font file to use for which font and style?
Does anyone have any code that shows how to retrieve the font file that is being used for a particular label, control etc?
I've tried a few APIs but no luck.
Thanks
How To Get Font File Name
I found some code which is working but only with TTF and with os language dependency. Is there some other method?
Like: I know Arial Bold and I want to get ARIALBD.TTF
Which works with *.fon files too!
It will go through all files and searching for the given font name!
Code:
Private Declare Function CreateScalableFontResource Lib "gdi32" Alias "CreateScalableFontResourceA" (ByVal fHidden As Long, ByVal lpszResourceFile As String, ByVal lpszFontFile As String, ByVal lpszCurrentPath As String) As Long
Private Function GetFontName(FileNameTTF As String)
Dim hFile As Integer
Dim Buffer As String
Dim FontName As String
Dim TempName As String
Dim iPos As Integer
TempName = App.Path & "TEMP.FOT"
If CreateScalableFontResource(1, TempName, FileNameTTF, vbNullString) Then
hFile = FreeFile
Open TempName For Binary Access Read As hFile
Buffer = Space(LOF(hFile))
Get hFile, , Buffer
iPos = InStr(Buffer, "FONTRES:") + 8
FontName = Mid(Buffer, iPos, InStr(iPos, Buffer, vbNullChar) - iPos)
Close hFile
Kill TempName
End If
text = text + """" + Mid(FileNameTTF, InStrRev(FileNameTTF, "") + 1) + """" + " " + FontName + vbCrLf
End Function
Set Font In Txt File.
hello friends!!
I have to set any particular font in text file through visual basic. How can i do this ..
pls can anyone help me?
Thanks in advance!!!!
Outputting File W/ Font
I just started learning VB when i got bored with java's GUI and i made some really quick wordpad thing
is there any way to save the current font + size to the file without it being readable like all other note pads do
i know the common dialog's fontname and fontsize things so i can change the font but i dont know how i would save that info into the txt file
Font Embeding With Exe File
hi,
Does anyone knows how to embed font with exe fle that works on all windows version.
Basicly, What I want..everytime the user start my programe, programe will check if the embeded font exist in the user system or not ? if not it will installed the font before my programe run..
Thanks...
Set Font For The Text File Using Vb 6.0
hi all..
i had created a pdf-text conveter.. i just want to set the font for that text file using vb 6.0..the font value has to remain when i re-open..please provide me some suggestion..
Font Of Output File
Hi. Can someone let me know how to specify the font when opening and writing to a file in VB6? Any help is appreciated.
Change TXT File Font
I need to write some data to a TXT file, but I need the user to open it with an specific font, else there would be problems, look..
Using Courier, Works fine:
iiiiiii SomeText Look Its Aligned
AAAAAAA SOMEtext Look Its Aligned
Using Arial, Problems..(using the same text)
iiiiiii SomeText Look
AAAAAAA SOMEtext Look
I need to align each column, to do that, I use Len(), so before doing that,
I have to be sure it will be a fixed length font, else..
len("iiiiii") = len("AAAAAA"), but the first string is shorter.
So, How to be sure that notepad will use a font like Courier and Not fonts like Arial?
Font File In Application
i have this font file on my system (true type fomt file),used it in my apps i developed,but any time i run the app on my friends system,the font is replaced with a general type of font because my font is not present in my friends system.i want to copy the font along with my app but how will i link the font to the app on a system that does not have the font
Help Find Font Path And File
Hi,
Does anyone know how I can find this information. Given font Name (i.e. Swiss BT), How can I find the path to the file (for example c:windowsfontssw721XXX.ttf.
Can anyone help with that?
I have looked at API's like EnumFonts, but I cannot seem to find this information.
Thanks,
kt
How To Retrieve The Fonr Name From A Font File
Hello,
I wrote an application that installs new fonts on a pc, without getting the messagebox when a font is already installed. It works fine, but I want te retrieve the font name from a font file so that I can add it to a list instead of the file name.
Is there maybe an API-call that I can use ?
Anyone can help me ?
Use A Font File Instead Of System Fonts
Hello,
I am looking for a way that i can use raw *.TTF and *.FON files on a label. I know that Label1.font will be just the name of the font, it needs to be set so i can say somthing like Label1.FontFile = curdir & "myfont.ttf" Ive looked around and i cant see anything on this (watch somone find it in a few mins ). Any help is appreachiated
Thanks
~Cody Woolaver
|