Trying to set Font in VLDrawTextLayer
|
12-19-2011, 08:51 PM
Post: #7
|
|||
|
|||
RE: Trying to set Font in VLDrawTextLayer
Yes I could email Mitov but then the next person that has this problem won't know how we fixed it.
Discovered something this morning.. Not all Font Names on the computer work, not sure why but I sorta fixed it with a try.. catch in case the user picks a font name that causes the error. try { // Not all Font names work VLDrawTextLayer1->Font->Name = GrabForm->FontName; } catch ( ... ) { // Set to something known to work VLDrawTextLayer1->Font->Name = "Microsoft Sans Serif"; } This particular computer has a Font named "MS Sans Serif" (among others) that is listed in a TFontDialogue but if you select it you get the error at run time. I don't understand enough about the different type fonts to know why it doesn't work. This is easily duplicated by simply dropping a TFontDialogue on a form with a VLDrawTextLayer and assigning the TFontDialogue properties to the VLDrawTextLayer. if(FontDialog1->Execute()) { VLDrawTextLayer1->Font->Name = FontDialog1->Font->Name; VLDrawTextLayer1->Font->Size = FontDialog1->Font->Size; VLDrawTextLayer1->Font->Brush->Color = FontDialog1->Font->Color; // This doesn't wok VLDrawTextLayer1->Font->Style = FontDialog1->Font->Style; } If you pick a good font name everything works as expected except the color. If you leave the color line in, the text will default to transparent regardless of what color you pick in the FontDialogue. So the next question is how do you assign FontDialog1->Font->Color to VLDrawTextLayer1->Font->Brush->Color? |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Trying to set Font in VLDrawTextLayer - BReeves - 12-18-2011, 11:16 PM
RE: Trying to set Font in VLDrawTextLayer - Dave - 12-18-2011, 11:42 PM
RE: Trying to set Font in VLDrawTextLayer - BReeves - 12-19-2011, 02:32 AM
RE: Trying to set Font in VLDrawTextLayer - Dave - 12-19-2011, 07:11 AM
RE: Trying to set Font in VLDrawTextLayer - BReeves - 12-19-2011, 07:36 AM
RE: Trying to set Font in VLDrawTextLayer - Dave - 12-19-2011, 08:01 AM
RE: Trying to set Font in VLDrawTextLayer - BReeves - 12-19-2011 08:51 PM
RE: Trying to set Font in VLDrawTextLayer - Dave - 12-20-2011, 10:19 AM
RE: Trying to set Font in VLDrawTextLayer - BReeves - 12-20-2011, 06:39 PM
RE: Trying to set Font in VLDrawTextLayer - Dave - 12-20-2011, 10:03 PM
RE: Trying to set Font in VLDrawTextLayer - BReeves - 12-21-2011, 12:43 AM
RE: Trying to set Font in VLDrawTextLayer - Dave - 12-20-2011, 10:39 PM
|
User(s) browsing this thread: 3 Guest(s)