?
Solved

Canvas text size

Posted on 2001-08-06
3
Medium Priority
?
205 Views
Last Modified: 2010-04-06
I want to print a number on form canvas. The number is inside a box.

In a procedure I wrote

Var  Rect : TRect;
begin
  Rect := ...
  canvas.font.height := rect.bottom -rect.top - 5;
  textrect(rect.left, rect.top, inttostr(Num));
end;

I found the size of the number was changed with the rect's size, but it's smallest size is about 6,how can I let it smaller?

PeterShaw
0
Comment
Question by:petershaw8
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Expert Comment

by:bugroger
ID: 6355261
Hi,
 I think you don 't use a TrueType - Font.

Try to set the font to a TrueType Font:

Var  Rect : TRect;
begin
 Rect := ...
 Canvas.Font.Name := 'MS Song'; <-- Set Font to TT - Font
 canvas.font.height := rect.bottom -rect.top - 5;
 textrect(rect.left, rect.top, inttostr(Num));
end;

Now the smallest size should be 1 !!!

GL
 Bug





0
 

Author Comment

by:petershaw8
ID: 6376255
Hi,
Iam using the default font, that is MS Sans Serif. Is it a TT font?

Thankuvery much.

PeterShaw
0
 
LVL 2

Accepted Solution

by:
bugroger earned 400 total points
ID: 6377925
Hi,

The MS Sans Serif is not a TrueType Font.

If you want to know if a Font is a TrueType Font
you can look at the FontDialog.
Just klick on [...] at the "FONT" Property of any
component which used this property.
If a TT-Glyph will be display on the left side of the
FontName (in the ListBox) then it is a TrueType Font.


GL
 Bug









0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question