Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / October 2004

Tip: Looking for answers? Try searching our database.

**********DrawString is not drawing the text at Point(0,0)**********

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ponnurangam - 21 Oct 2004 12:26 GMT
Hi,

I am trying to draw text on a bitmap at (0,0)

But Graphics.DrawString("the brown fox",drawFont,drawBrush,drawPoint) is not
writing exactly at (0,0)

drawFont: Font("Arial", 9, Style, GraphicsUnit.Point)

drawPoint: (0,0)

There is space at left and at the Top.

For some fonts the space at the Top is more.

The spacing at the Top is not even for all the fonts.

I don't want the space at the top. If there is space at the top, it should
be even for all the fonts

Any help would be appreciated

Thanks

Ponnurangam
Bob Powell [MVP] - 21 Oct 2004 12:46 GMT
The positioning of the font is made according to the height of the EM square
defined by the font. Some fonts have glyphs that sit on different base-lines
and extend upwards to different heights within the EM square. In order to
position letters so that the top of the letter exactly touches a specific
picel would require individual analysis of the font tables and adjustment of
the output position on a character by character basis. This isn't possible
with the standard methods available to GDI+ and certainly not available to
DrawString.

I have written the code that does the font table analysis to extract such
information from a TTF file but it's a whole lot of work and I'm sorry but I
don't give that away for free.

Signature

Bob Powell [MVP]
Visual C#, System.Drawing

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml

> Hi,
>
[quoted text clipped - 21 lines]
>
> Ponnurangam
Ponnurangam - 21 Oct 2004 13:36 GMT
Hi Bob,

Can you tell me  about the font table analysis to extract information from a
TTF file.

Thanks

Ponnurangam

> The positioning of the font is made according to the height of the EM
> square
[quoted text clipped - 40 lines]
>>
>> Ponnurangam
Bob Powell [MVP] - 21 Oct 2004 22:12 GMT
Here's where I got my information from... Good luck!

http://fonts.apple.com/TTRefMan/index.html

Chapter 6, Font Files, explains the tables you need to decode.

Signature

Bob Powell [MVP]
Visual C#, System.Drawing

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml

> Hi Bob,
>
[quoted text clipped - 49 lines]
> >>
> >> Ponnurangam

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.