Canvas Font doesn't match font.


Consider measuring text width for display on a status bar: var szText: string; nWidth: Integer; begin szText := 'www.borland.com'; nWidth := StatusBar1.Canvas.TextWidth(szText); end; You'll get a value, e.g. 85px for a 8pt (12px) font. Then we scale the status bar, ...
Posted On: Thursday 22nd of November 2012 11:15:11 PM Total Views:  72
View Complete with Replies

RELATED TOPICS OF Delphi Programming PROGRAMMING LANGUAGE




Fixed width font

Anyone knows besides Courier New any font has fixed width I would like to find the font appearence similar to MS Sans Serif.
VIEWS ON THIS POST

49

Posted on:

Wednesday 26th September 2012
View Replies!

Change caption font style of tpagecontrol keeping WinXP style of the control

Hi ! I've spent almost a day searching the Net for solutions, but I didn't find any. (please note that I've even looked at third party controls, but there is none which does exactly what I'm looking for) Here is what I'm after: I'd like to change the font style of my TPageControl buttons' captions. Now this would be simple using the OnDrawTab event, but if I override it, the control loses it's themed-style under WinXP. I've heard that this can be achieved, but I have to draw the themed look by hand. The problem is that I've no idea how to do this. I've found some code but it's in C++ not Delphi, and I don't know if it works or not: http://groups.google.hu/group/borlan...b1606aefb7c6c1 Could someone help me with this please
VIEWS ON THIS POST

47

Posted on:

Wednesday 26th September 2012
View Replies!

D6 - SQL Editor Size and font

!! Is there any "trick" to change the Command Text Editor which is used to edit the SQL of any of the IBX component A fixed font like courrier new would be fantastic! And I also would like to change the default size of the dialog box... Something bigger... I use Delphi 6.
VIEWS ON THIS POST

53

Posted on:

Friday 28th September 2012
View Replies!

component caption font color

How do I change the component font color caption display( say the Indy idSMTP) from white with a beige background to black It is the same with Dialogs, Internet Express, etc. Libby
VIEWS ON THIS POST

69

Posted on:

Tuesday 2nd October 2012
View Replies!

How to determine whether a file path matching with a search pattern/ wildcard ?

I have a list of file paths (TStringList), which look like the following: system\core\index.xml system\core\index.sql system\core\table.sql app\core\index.xml app\core\index.sql app\core\table.sql I wish to have a method something like the following, which accept Search Pattern/Wildcard, and search through aInputList to find the matching file with the wildcard and insert those matching entry to aOutputList. procedure(const aSearchPattern: string; const aInputList: TStringList; out aOutputList: TStringList); Is there any method provided in Delphi that can help me determine whether the file path matching the wildcard e.g *.xml, *.*, ..\test\*.sql and etc.
VIEWS ON THIS POST

65

Posted on:

Friday 5th October 2012
View Replies!

Retrieving detailed info for fonts

http://theshipmanfamily.com/FontInfo.png Above is URL to a screenshot of the info on the Arial Font that a utility named The Font Thing creates. This utility is old and does not support Open Type Fonts. The author is nowhere to be found and I want to write a utility that does the same job as this one but support OTF and Type 1 fonts. Anyone know how to get all that info from a particular font file I know about LOGFONT and TEXTMETRICS but there is other info on that screen that I have no idea where it came from. I have found nothing in my searches. Can anyone help out\t
VIEWS ON THIS POST

34

Posted on:

Friday 5th October 2012
View Replies!

Parent font

I'm subclassing a component (nlhRichEdit) to a) set the font to the parent and b) add borders. As part of it I need to get the parent font to apply it. I've created a classbasedonTComponent publishing Font so I can get at it but itisn't available in nlhRichEdits constructor. Where is the right point to get this info and apply it Roy Lambert
VIEWS ON THIS POST

41

Posted on:

Sunday 7th October 2012
View Replies!

canvas printing?

Ok How do you print the canvas to the printer - - I am making an in house app to print labels to a label printer idea is to use a hidden form's canvas and put the text on the canvas and then send that to the printer. I could also use a TImage and print that if it is easier.
VIEWS ON THIS POST

125

Posted on:

Tuesday 9th October 2012
View Replies!

Parent font

I'm subclassing a component (nlhRichEdit) to a) set the font to the parent and b) add borders. As part of it I need to get the parent font to apply it. I've created a classbasedonTComponent publishing Font so I can get at it but itisn't available in nlhRichEdits constructor. Where is the right point to get this info and apply it Roy Lambert
VIEWS ON THIS POST

43

Posted on:

Tuesday 16th October 2012
View Replies!

How can one increase the font size of the Object Inspector in D2007?

Hi! With higher screen resolutions the Object Inspector's font size tends to be too small. Is there a way to change that font size to some higher value The Object Inspector's 'Properties' form does not seem to make that possible.
VIEWS ON THIS POST

335

Posted on:

Tuesday 16th October 2012
View Replies!

canvas.textheight return value problem

canvas.textheight(str) always seems to return the same value, regardless of the string parameter used. That is, except for '' (where it returns 0), using 'jT' or '.' makes no difference. what could be wrong Frank. PS: I'm trying to 'correct' canvas.TextWidth when using fsItalic
VIEWS ON THIS POST

160

Posted on:

Tuesday 16th October 2012
View Replies!