473,466 Members | 1,334 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

gdmodule true type font size


When using gdmodule to draw text using true type fonts

im.string_ttf(font, fontsize, angle, (x,y), s, color)

the docs say 'draw string s at (x,y) using the TrueType font at the
given pointsize and angle.' It is not clear to me how gd handles
point size. A fontsize of 12 should be 12/72 = 1/6 inches tall but
how does gd decide what an inch is? 72 pixels? Is there some scale
parameter or constant that allows gd to make the conversion from
pixels to points?

I want my text to scale with image resolution which is determined by a
dpi parameter, and I tried doing

scale = dpi/72.0
im.string_ttf(font, scale*fontsize, angle, (x,y), s, color)

but the fonts are larger than they should be, at least according to my
calculations.

Thanks,
John Hunter

Jul 18 '05 #1
0 1641

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John Hunter | last post by:
Does gd lib or gdmodule support clipping? I would like to set a clip rectangle and when I issue drawing commands (like im.polygon) have only the part of the polygon inside the clip rectangle...
0
by: John Hunter | last post by:
GD module has a constant gdMaxColors >From the web page: Maximum number of colors in an image; GD will likely change this figure in a future version. Is there any way to increase this...
5
by: Eduardo Elgueta | last post by:
Hi All, I'm trying to setup matplotlib (http://matplotlib.sourceforge.net/) in a Win XP box. I have two questions: 1. How do I install the GD Lib (http://www.boutell.com/gd)? The zip...
1
by: Edward | last post by:
I am having a terrible time getting anything useful out of a listbox on my web form. I am populating it with the results from Postcode lookup software, and it is showing the results fine. What...
2
by: a_man | last post by:
hello everyone I need to print with the e.graphics.drawstring method. And it takes among other a font object as argument. But I want to use a font which is not a true type. Therefore im stuck...
5
by: Christian Stapfer | last post by:
After switching from Python 2.3 to 2.4 (Enought), PIL throws an exception that did not occur formerly (under Python 2.3) when executing ImageFont.truetype(font, size) where font =...
13
by: =?Utf-8?B?S2VzdGZpZWxk?= | last post by:
Hi Our company has a .Net web service that, when called via asp.net web pages across our network works 100%! The problem is that when we try and call the web service from a remote machine, one...
1
by: chrisj | last post by:
I'm using freeASPupload and got some assistance integrating to a Member script. It works successfully. In this modified version there are two groups that use this upload script. Members of one...
16
by: markjavascript | last post by:
Hi, In an editable div, I inserted a big letter, Rng.pasteHTML("<font size=5>A</font>");,fine. However, after that, when type in other letters, (sometimes) I got big letters with size=5. Here...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.