AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren

Something wrong in text drawing

Ein Thema von WojTec · begonnen am 20. Aug 2011 · letzter Beitrag vom 21. Aug 2011
Antwort Antwort
Fusel

Registriert seit: 27. Okt 2006
8 Beiträge
 
#1

AW: Something wrong in text drawing

  Alt 20. Aug 2011, 15:07
Set your specific Fontname with TCanvas.Font
  Mit Zitat antworten Zitat
WojTec

Registriert seit: 17. Mai 2007
482 Beiträge
 
Delphi XE6 Professional
 
#2

Re: Something wrong in text drawing

  Alt 20. Aug 2011, 15:26
I already did it, Arial. Do you mean problem is with font?
  Mit Zitat antworten Zitat
Namenloser

Registriert seit: 7. Jun 2006
Ort: Karlsruhe
3.724 Beiträge
 
FreePascal / Lazarus
 
#3

AW: Something wrong in text drawing

  Alt 20. Aug 2011, 17:35
It has nothing to do with the font. It’s just windows’ subpixel rendering (ClearType) which smoothes out the edges of your text and makes it appear more defined. This technology was introduced with Win XP and is turned on globally by default since Vista.

You can however disable ClearType for a specific canvas.
  Mit Zitat antworten Zitat
WojTec

Registriert seit: 17. Mai 2007
482 Beiträge
 
Delphi XE6 Professional
 
#4

Re: Something wrong in text drawing

  Alt 20. Aug 2011, 18:44
Hm, for me don't working, ClearType is as was.
  Mit Zitat antworten Zitat
Namenloser

Registriert seit: 7. Jun 2006
Ort: Karlsruhe
3.724 Beiträge
 
FreePascal / Lazarus
 
#5

AW: Something wrong in text drawing

  Alt 20. Aug 2011, 20:34
It should work, though. Post some code, please.
  Mit Zitat antworten Zitat
WojTec

Registriert seit: 17. Mai 2007
482 Beiträge
 
Delphi XE6 Professional
 
#6

Re: Something wrong in text drawing

  Alt 21. Aug 2011, 10:37
Delphi-Quellcode:
begin
  with TBitmap.Create do
  begin
    SetSize(100, 100);

    Canvas.Brush.Color := clWhite;
    Canvas.Pen.Color := clBlack;

    Canvas.FillRect(BoundsRect);

    Canvas.Font.Name := 'Arial';
    Canvas.Font.Size := 36;
    ChangeCleartype(Canvas, False);

    Canvas.TextOut(10, 10, '123'); // Without CT

    Canvas.Font.Size := 20;
    Canvas.TextOut(10, 60, '1234567'); // With CT

    SaveToFile('C:\0.bmp');
  end;
end;
I know!, need to call it before render text and after last setting! Ach.
Is possible to set it permanently for specified font?

Geändert von WojTec (21. Aug 2011 um 10:46 Uhr)
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.399 Beiträge
 
Delphi 12 Athens
 
#7

AW: Something wrong in text drawing

  Alt 21. Aug 2011, 11:19
Ja.

Leite dir TFont ab und baue diese Funktionalität dort ein.
Ein Therapeut entspricht 1024 Gigapeut.
  Mit Zitat antworten Zitat
Antwort Antwort

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:44 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz