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 30-01-2006, 20:42
SteveDude SteveDude is offline
Senior Member
 
Join Date: Dec 2005
Location: Salina, Kansas USA
Posts: 149
Default ...beat to death...

Alex,

I don't really want to beat our conversation to death on CenterX and TopY, because I understand your reasoning completely.

When dealing with Text, CenterX works as desired as long as the alignment is set to match. At this point I don't even care why something worked in B6 but is off in the Gold, but what is needed is a consistant and reliable way of setting the top of an Ascending character at an exact location. What happened with one piece of code, text was set to have the ascender be at exactly 1/2 inch below the top of the page and it worked fine. For some reason in the gold it was no longer the case, but was 1/2 inck higher with 72 point type making it partly off the page. Who knows maybe my calculations were wrong, but I didn't touch the DLL between version change.

I haven't been on your site much, but probably should because I know I can learn some things from the master of the masters. I consider myself pretty good at work arounds and have found them for the problems I mentioned and I know you have your hands full, but I would like to see this happen. It's an important thing in the screen printing industry, especially fitting text to the bottom of a circle. Again in the gold the text fitting with ascender aligning at the bottom of the circle was off and I didn't use CenterX or TopY to calculate the positioning. In 12 using PlaceOnOtherSide worked great, but seems non functional in X3. Haven't tried it in the Gold Version.

Hope I didn't offend you, I was just having a bad day.

Steve
Reply With Quote
  #2  
Old 30-01-2006, 21:04
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Quote:
Originally Posted by SteveDude
Hope I didn't offend you, I was just having a bad day.
Of course not! Did I sound offended? If so, sorry, didn't mean to...

For people who don't know, we are continuing a conversaition from Corel newsgroups. Here is part of the question:

Quote:
Originally Posted by SteveDude
I have been using something like this to set the location of some artistic
text...

x = .ActivePage.CenterX
y = .ActivePage.TopY - Margin - ObjectHeight
Set s = .ActiveLayer.CreateArtisticText(x, y, strText$, , , ,
sngFontHeight, , , ,cdrCenterAlignment)

In B6 it aligned as expected. In the gold it aligns 1/2 inch higher than
before. I am getting the ObjectHeight by converting the FontHeight to the
document units. Same code, different results.
It is hard for me to say what is the problem without seeing all the code and the end result, but I agree that more font information would be very useful, such as placement of each text baseline, text ascenders and descenders, each character position on the page, bounding boxes of characters, words, lines, paragraphs... I hope that the next version will open up at least some of those
Reply With Quote
  #3  
Old 30-01-2006, 21:44
SteveDude SteveDude is offline
Senior Member
 
Join Date: Dec 2005
Location: Salina, Kansas USA
Posts: 149
Default File Name Inserter

Alex,

Try the File Name Inserter in DRAW X3 setting text in the top quadrant and you'll see what I mean.

Didn't realize it was yours.

Steve
Reply With Quote
  #4  
Old 31-01-2006, 09:10
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Steve,

I haven't tried the File Name Inserter yet (need to install it) but I did a quick test in CorelDRAW 12 and X3 and it seems to work the same way. Here are the sample code for v12:

Code:
Sub Test12()
    Dim x As Double, y As Double
    Dim txtSize As Double
    txtSize = 24
    x = ActivePage.SizeWidth / 2
    y = ActivePage.SizeHeight - ActiveDocument.ToUnits(txtSize, cdrPoint)
    ActiveLayer.CreateArtisticText x, y, "Text", Font:="Arial", _
                    Size:=txtSize, Alignment:=cdrCenterAlignment
End Sub
and X3:

Code:
Sub TestX3()
    Dim x As Double, y As Double
    Dim txtSize As Double
    txtSize = 24
    x = ActivePage.CenterX
    y = ActivePage.TopY - ActiveDocument.ToUnits(txtSize, cdrPoint)
    ActiveLayer.CreateArtisticText x, y, "Text", Font:="Arial", _
                    Size:=txtSize, Alignment:=cdrCenterAlignment
End Sub
The result is absolutely identical.

What am I doing differently?
Reply With Quote
  #5  
Old 01-02-2006, 21:46
SteveDude SteveDude is offline
Senior Member
 
Join Date: Dec 2005
Location: Salina, Kansas USA
Posts: 149
Default hmmmm...

Alex,

I did figure it out and know why the results were different in 12 and X3, but still don't know why it worked in B6 and not in the gold. As I said, in the DRAWings X3 Beta the results were different than straight out DRAW X3. For circle text text in 12, Place on other side worked, so therefore there were no issues with aligning text to the bottom of the path. In X3, it doesn't work (at least in B6 it didn't, I did log a bug on it). If you change the sizes of the font in the sample you show you will notice the placement is different, but yes it is identical in 12. In my version I compensated for the offset in font size differences so the placement would be same no matter what. It was that compensation I needed to change to make it work in the Gold. This is part of a new feature I am adding to the DRAWings X3 plugin, so I never noticed the problem in 12.

Steve

Last edited by SteveDude; 01-02-2006 at 21:48.
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


All times are GMT -5. The time now is 07:36.


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