OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 25-01-2005, 16:58
bbolte
Guest
 
Posts: n/a
Default how to specify the font size in inches

i know this has to be simple, but i can't seem to put it all together. so far, i'm only able to specify in points and i need to set the size of the font in inches. here's what i've done so far:

i've set the ruler units in inches
i've tried 2-3 different ways of setting the font size

i know that when i'm working with text in Corel, i can pull up the format text dialog (cntrl-T) and it shows the font size in inches on the character tab. how can i do the same with code?
Reply With Quote
  #2  
Old 25-01-2005, 18:06
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,791
Blog Entries: 15
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default

Try this:

Code:
Sub TextInInches()

Dim s As Shape
Set s = ActiveLayer.CreateArtisticText(0, 0, "SAMPLE TEXT", cdrEnglishUS, , "Arial", ConvertUnits(1.5, cdrInch, cdrPoint), cdrFalse, cdrFalse, , cdrCenterAlignment)

End Sub
Hope it helps,

Shelby
Reply With Quote
  #3  
Old 25-01-2005, 19:50
bbolte
Guest
 
Posts: n/a
Default

hmmmm, that looks interesting. thanks. i'll let you know after i try it out tomorrow... thanks again.
Reply With Quote
  #4  
Old 26-01-2005, 08:42
bbolte
Guest
 
Posts: n/a
Default

that didn't work, it throws a compile error.

i did find something in "CorelScriptTools.ToPoints" but this still didn't size it correctly. i passed in 3" and it set it to 24 pts. still digging here...
Reply With Quote
  #5  
Old 26-01-2005, 08:45
bbolte
Guest
 
Posts: n/a
Default

i actually had to do this:

CorelScriptTools.ToPoints(CorelScriptTools.FromInches(ColJob(i).LineSize))


really wish there was a better way, would rather not use CorelScript. This is Corel v 11 by the way...
Reply With Quote
  #6  
Old 26-01-2005, 11:10
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,791
Blog Entries: 15
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default

You are corect the ConvertUnits is in CorelDraw 12 not 11. Lets see there are 72 points = 1 inch so how about just taking your variable times 72? Then you would not need the CorelScript Tools. Just a thought.

Shelby
Reply With Quote
  #7  
Old 26-01-2005, 11:37
bbolte
Guest
 
Posts: n/a
Default

i thought about that. but 24 pt Times isn't the same height as 24 pt Arial. which makes me question whether it would be that simple. on another application that we have, we had to end up making a database of pt sizes versus inches for each font we wanted to use - thankfully there was a limited number. this app will have a considerably larger number of fonts which will make that type of approach unreasonable.

and actually i found that my formula isn't working either.
Code:
CorelScriptTools.ToPoints(CorelScriptTools.FromInches(3))
actually comes out to 2.221 inches. not sure why...
Reply With Quote
  #8  
Old 26-01-2005, 13:54
bbolte
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by shelbym
72 points = 1 inch so how about just taking your variable times 72?
just for kicks, i tried this and it gave me the same as this did.
Code:
CorelScriptTools.ToPoints(CorelScriptTools.FromInches(ColJob(i).LineSize))
this particular instance the point size was figured to 216 (3" x 72pts). but it really only measures to 2.222"? what I needed was 291.x pts. that gave me 3" for Arial.

it shouldn't be this difficult i wouldn't think. the other problem with just sizing the shape to the given dimension is that i need the cap height to be this size. if there are any descenders, it throws the whole thing off. there's got to be a way to do this...
:?
Reply With Quote
  #9  
Old 26-01-2005, 14:23
bbolte
Guest
 
Posts: n/a
Default

even more fuel for the fire. Corel's status bar displays the incorrect measurment. if you open the "format Text" dialog, it displays the incorrect height in inches. it looks as though it is simply doing pt / 72 = cap height in inches, which won't be accurate.
Reply With Quote
  #10  
Old 26-01-2005, 15:36
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,791
Blog Entries: 15
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default

You are correct that if you type a 72point "H" in the Arial font it is not the same height as a 72point "H" in Times New Roman. I don't recall the reasoning, something to do with the space between lines or the desending characters. I know to a font guy it makes sense, but if you are in the sign or monument business you want all the "H" to be 1" or 72 points.

What I ended up doing was creating my own fonts in Macromedia's Fontographer. That way when I say 1" I really get it. So you might consider this an option.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
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
InsertAfter - Retain Font Size Craig Tucker CorelDRAW/Corel DESIGNER VBA 3 07-01-2005 07:42
Bitstream Font Nav Problem ddonnahoe General 0 16-12-2004 08:25
Reading Font Properties from selected text in CD9 sherman01 CorelDRAW/Corel DESIGNER VBA 2 24-11-2004 07:59


All times are GMT -5. The time now is 06:43.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com