![]() |
#1
|
|||
|
|||
![]()
Hi-
If I try to open or import a file manually in Draw11 and that file references fonts that aren't available on my computer, I get a warning and a chance to substitute another font (I know that this behavior is set under the Panose matching window). However, if I import via Activelayer.Import myFileName, I do not get a warning and the default font is substituted automatically. The StructImportOptions object does not appear to offer any control over this behavior. I'd prefer to be warned if a font is missing. How can I achieve this? Thanks, Rob |
#3
|
|||
|
|||
![]()
This worked on one application (from vba), but doesn't work in another application. In fact, although I set panosematching = cdrPanoseprompt, I can't get Draw to prompt me.
|
#4
|
|||
|
|||
![]()
When I set matching = cdrPanosePrompt (from VB via COM), I would expect Draw11 to pop up the modal font substitution dialog box. It doesn't.
Instead, it performs a permanent font substitution. Suprisingly, this is not even the default behavior I have set in the options menu. It's critical that I be able to identify situations in which fonts are being substituted or are missing. How can I acheive this? |
#5
|
||||
|
||||
![]()
Rob,
I have investigated this issue a little further and here is what I have found out. Each time you connect to CorelDRAW from an out-of-process controller, a new instnace of the Application object is created for you. There is also an application instance provided for VBA the very first time it is initialized. The thing is that the PanoseMatching property is stored in the Application class and it turns out that each class instance has its own settings which do not affect each other. It also happened that the VBA's Application object is the one whose PanoseMatching settings is used by the application to control that dialog on import/open. This is definitely a bug but understanding why it happens might allow us to find a workaround. Fortunately there is one. The trick is to get the Application object used by VBA. Good thing is that most CorelDRAW object have an Application property that return the Application object which is the same Application object used by VBA. So in order to get it we need:
Here is how you do it: Code:
Sub TestPanose() Dim Draw As CorelDRAW.Application Dim doc As Document Set Draw = New CorelDRAW.Application Draw.InitializeVBA Draw.Application.PanoseMatching = cdrPanosePrompt Set doc = Draw.CreateDocument doc.ActiveLayer.Import "D:\SomeFile.cdr" End Sub Finally I get the reference to the VBA's Application object by using the Application property of our Application object (looks heavy but it's not as complicated as it sounds). If you do not initialize VBA, then each time you access an object's Application property, a new instance of Application object will be created and destroyed as soon as you release the reference to it. So, another trick could be to use the second copy of the Application object and keep it referenced as long as you application is running: Code:
Sub TestPanose() Dim Draw As CorelDRAW.Application Dim doc As Document Set Draw = New CorelDRAW.Application Set Draw = Draw.Application ' Get a reference to the "VBA" app object instead Draw.PanoseMatching = cdrPanosePrompt Set doc = Draw.CreateDocument doc.ActiveLayer.Import "D:\SomeFile.cdr" End Sub I hope this helps. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
T1 fonts & Bitstream font nav. vs Corel draw 12 & 11 | xombie | General | 2 | 22-05-2005 17:35 |
weird font issue | bbolte | CorelDRAW/Corel DESIGNER VBA | 1 | 21-04-2005 15:20 |
how to specify the font size in inches | bbolte | CorelDRAW/Corel DESIGNER VBA | 14 | 26-01-2005 22:19 |
Bitstream Font Nav Problem | ddonnahoe | General | 0 | 16-12-2004 08:25 |
Missing font dialog on import | click101 | CorelDRAW/Corel DESIGNER VBA | 2 | 28-04-2003 12:32 |