Richedit Font won't change on target PC
On my development PC I can change the font in the RichView->RichEdit of a report.
I am trying to set it to "Courier New"
This works fine every time on my development PC but when I install my application on another PC it goes to some sort of non fixed width font and messes up my display.
I am populating the RichEdit part of report in code and using SelStart and SelText Correctly as far as I can see.
I have verified the computer the application is installed on has the "Courier New" font
For testing I added a dropdown combo box to allow me to pick the font for the RichEdit to use
If I pick other fonts such as Impact these seem to change on the destination PC, choose wingdings and it doesn't change.
I need to use the fixed width fonts as I wish to draw simple ascii boxes.
It seems like the RichEdit is only allowing a subset of the available fonts.
Any suggestions as to how I can determine what the error is.
Works absolutely correctly on my development PC both in and out of the C++ Builder IDE
I am trying to set it to "Courier New"
This works fine every time on my development PC but when I install my application on another PC it goes to some sort of non fixed width font and messes up my display.
I am populating the RichEdit part of report in code and using SelStart and SelText Correctly as far as I can see.
I have verified the computer the application is installed on has the "Courier New" font
For testing I added a dropdown combo box to allow me to pick the font for the RichEdit to use
If I pick other fonts such as Impact these seem to change on the destination PC, choose wingdings and it doesn't change.
I need to use the fixed width fonts as I wish to draw simple ascii boxes.
It seems like the RichEdit is only allowing a subset of the available fonts.
Any suggestions as to how I can determine what the error is.
Works absolutely correctly on my development PC both in and out of the C++ Builder IDE
Comments
ie windows system printers etc
Default printer Epson Stylus photo RX650,
Installed printers Epson Stylus, pdfcreator, Microsoft XPS Document Writer, fax, Send to OneNote 2010
Failed targets:
Windows 7 32 bit and windows 8 32 bit have both been tested but fail
Default printer pdfArchitect
Installed printers pdfArchitect, fax, Samsung CLP-310
I really don't wish to have to force the user to have a particular printer installed for this to work and would have thought "Courier New" a pretty safe font to choose.
I am creating the richview at run time in code and it is located on a single masterdata band.
Do I need to do something to let it know about the fonts?
A scan of the windows fonts available shows Courier New as being there and I can use the font in a standard TMemo box on my form without issue.
Code is built using C++ Builder XE2
the rtf object gets its fonts from the rtf text you are supplying
you could try turning off wyswyg to see if that makes a difference.
I will try turning off wysiwyg and let you know the result.
I am not loading any RTF from a file I am simply add text using the
SelStart = GetTextLen()
SelAttributes->Name = "Courieir New"
SelAttributes->size = 10
SelText = "My New Text";
This as far as I am aware is the correct way for me to do.
The font is already on the system but for some reason it doesn't get correctly selected when I use the SelAttributes method on the other PC.
I add multiple bits of text and every time I set the font using the SelAttributes.
I even added the option to change the font name on my PC and if I change the font I am using it always changes in the RichEdit.
This is both in and out of the IDE.
On the other PCs it seems to always just use the default font, almost like the richedit needs something initialised in order to see the fonts available.
The same occurs if I place a rich edit object into my fr3 file at design time so it is not created at run time but only written to.
I am using line drawing characters to draw a table and the use the unicode values for the Line drawing U+250x to U+257x.
When I add the richtext it is using courier new correctly for the standard text characters but Segio UI Symbol for the bits using the unicode lindraw characters.
The RichEdit sees the unicode character and finds courier New doesn't support those so is looking for a font which contains the unicode characters and replacing with that.
So what I need to do now is some more research to find what line draw characters (if any) standard Courier New Supports.
Also why my PC supports them.