php.de

Zurück   php.de > Webentwicklung > PHP-Fortgeschrittene

PHP-Fortgeschrittene Arbeiten mit PHP ohne Einschränkungen

Antwort
 
LinkBack Themen-Optionen Thema bewerten
Alt 30.07.2004, 11:15  
Gast
 
Beiträge: n/a
Standard Schriften in GD

Hallo,

ich programmiere zur Zeit an einem recht umfangreichen Projekt.
Ich verwende die GD-Library von PHP, um Bilder mit Texten zu erzeugen.
Was mir auffällt, wenn ich im HTML einen Text ausgeben lasse mit z.B. Schriftgrösse 10 Pixel in der Schriftart Verdana, dann ist er zwar "klein" und "eckig", aber man kann ihn noch so lesen.

Wenn ich in GD mittels der imagettftext() Funktion Text ausgebe sieht dieser schon viel anders aus. Gut, er ist "gerundet", aber weniger gut lesbar finde ich bei kleineren Schriften.

Meine Frage: Kann ich per GD auch ein Text so erzeugen lassen, dass er aussieht, als wenn ich ihn im HTML mit einer Schriftengrösse von 10px ausgeben würde?

Vielen Dank für eine Antwort im Voraus !
  Mit Zitat antworten
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 30.07.2004, 12:09  
Erfahrener Benutzer
 
Registriert seit: 19.06.2004
Beiträge: 665
konsti
Standard

probiers mal mit
PHP-Code:
imageantialias($imfalse); 
wobei $im der zeiger auf dein image ist...
siehe auch:
http://de3.php.net/manual/de/functio...eantialias.php
konsti ist offline   Mit Zitat antworten
Alt 30.07.2004, 14:27  
Gast
 
Beiträge: n/a
Standard

hi,

das steht alles im manual. ich frage mich manchmal echt wie ihr eure projekte hinbekommt (:

Zitat:
Write text to the image using TrueType fonts (PHP 3, PHP 4 )
array imagettftext ( resource image, int size, int angle, int x, int y, int color, string fontfile, string text )

imagettftext() draws the string text in the image identified by image, starting at coordinates x, y (top left is 0, 0), at an angle of angle in color color, using the TrueType font file identified by fontfile. Depending on which version of the GD library that PHP is using, when fontfile does not begin with a leading '/', '.ttf' will be appended to the filename and the library will attempt to search for that filename along a library-defined font path.

The coordinates given by x, y will define the basepoint of the first character (roughly the lower-left corner of the character). This is different from the imagestring(), where x, y define the upper-right corner of the first character.

angle is in degrees, with 0 degrees being left-to-right reading text (3 o'clock direction), and higher values representing a counter-clockwise rotation. (i.e., a value of 90 would result in bottom-to-top reading text).

fontfile is the path to the TrueType font you wish to use.

text is the text string which may include UTF-8 character sequences (of the form: {) to access characters in a font beyond the first 255.

color is the color index. Using the negative of a color index has the effect of turning off antialiasing.
Sike
  Mit Zitat antworten
Alt 30.07.2004, 20:08  
Erfahrener Benutzer
 
Registriert seit: 19.06.2004
Beiträge: 665
konsti
Standard

des ist aber wohl ein fieser trick! ich finde meine version mit imageantialias() viel schöner! (so fern das funktioniert...)
konsti ist offline   Mit Zitat antworten
Alt 31.07.2004, 10:07  
Gast
 
Beiträge: n/a
Standard

@konsti:
Leider funktioniert das nicht mit dem antialias-Befehl, dieser ist anscheinend nur für Linien.

@sike:
Hat auch nicht geklappt, sieht bei mir nicht genauso aus, als per 'HTML' ausgegeben. Den Unterton mit RTFM hätten wir uns sparen können, oder?
  Mit Zitat antworten
Antwort


Themen-Optionen
Thema bewerten
Thema bewerten:

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 an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
[CSS2.0] Schriften einbetten - Kompatibilität PsychoEagle HTML, Usability und Barrierefreiheit 5 23.11.2006 12:55
Absoluten Pfad zu Schriften finden? GD Ministry PHP Tipps 2006 2 21.08.2006 10:28
Schriften Stümper HTML, Usability und Barrierefreiheit 8 07.03.2005 01:06
PDF Schriften: unterstreichen PHP Tipps 2004-2 1 23.12.2004 10:38
[Erledigt] Schriften und Farben PHP Tipps 2004 3 03.11.2004 15:34
[Erledigt] schriften für website HTML, Usability und Barrierefreiheit 2 15.10.2004 09:57
[Erledigt] Alle Schriften einlesen und im Auswahlmenü ausgeben PHP Tipps 2004 12 29.07.2004 16:29

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
php gd schriften einbetten, php gd fonts, gd-schriftarten, gd truetype fonts, font php text gd, was sind gd fonts, gd schriften, php image schriftarten klein lesbar, php imagefont verdana, php bild schrift unterstrichen, php gd schriftart, php gd image font verdana, tt schriften und gd php, php gd2 imagettftext different on two server, php imagettftext zu eng, gd library datei lesen, array in ttf schriftart ausgeben php, php imagettftext unterstrichen, gd2 truetype, unterstreichen text gd php

Alle Zeitangaben in WEZ +2. Es ist jetzt 22:19 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.