Jump to content
php.lv forumi

Gd


K|NG

Recommended Posts

GD

Kā lai uz bildes uzdrukā latviešu burtus? :(

krieviem ir paveicies viņiem ir convert_cyr_string, a mums?

 

CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality

<code><font color="#000000">

<font color="#0000CC"><?php header </font><font color="#006600">(</font><font color="#CC0000">"Content-type: image/jpg"</font><font color="#006600">);
</font><font color="#0000CC">$b</font><font color="#006600">=</font><font color="#0000CC">[url=http://lv.php.net/join]join[/url]</font><font color="#006600">(</font><font color="#CC0000">""</font><font color="#006600">,</font><font color="#0000CC">[url=http://lv.php.net/file]file[/url]</font><font color="#006600">(</font><font color="#CC0000">"teksts.txt"</font><font color="#006600">));
</font><font color="#0000CC">$b </font><font color="#006600">= </font><font color="#0000CC">[url=http://lv.php.net/str_replace]str_replace[/url]</font><font color="#006600">(</font><font color="#CC0000">"n"</font><font color="#006600">,</font><font color="#CC0000">" "</font><font color="#006600">,</font><font color="#0000CC">$b</font><font color="#006600">);
</font><font color="#0000CC">$b </font><font color="#006600">= </font><font color="#0000CC">[url=http://lv.php.net/str_replace]str_replace[/url]</font><font color="#006600">(</font><font color="#CC0000">"š"</font><font color="#006600">,</font><font color="#CC0000">"?"</font><font color="#006600">,</font><font color="#0000CC">$b</font><font color="#006600">);
</font><font color="#0000CC">$imagename </font><font color="#006600">= </font><font color="#CC0000">"bildes/sator.jpg"</font><font color="#006600">;
</font><font color="#0000CC">$im </font><font color="#006600">= @</font><font color="#0000CC">ImageCreateFromJPEG </font><font color="#006600">(</font><font color="#0000CC">$imagename</font><font color="#006600">);
</font><font color="#0000CC">ImageString</font><font color="#006600">(</font><font color="#0000CC">$im</font><font color="#006600">, </font><font color="#0000CC">5</font><font color="#006600">, </font><font color="#0000CC">82</font><font color="#006600">, </font><font color="#0000CC">67</font><font color="#006600">, </font><font color="#CC0000">"$b"</font><font color="#006600">, </font><font color="#0000CC">$im</font><font color="#006600">-</font><font color="#0000CC">10</font><font color="#006600">);
</font><font color="#0000CC">ImageString</font><font color="#006600">(</font><font color="#0000CC">$im</font><font color="#006600">, </font><font color="#0000CC">5</font><font color="#006600">, </font><font color="#0000CC">81</font><font color="#006600">, </font><font color="#0000CC">66</font><font color="#006600">, </font><font color="#CC0000">"$b"</font><font color="#006600">, </font><font color="#0000CC">$im</font><font color="#006600">-</font><font color="#0000CC">250</font><font color="#006600">);

</font><font color="#0000CC">ImageString</font><font color="#006600">(</font><font color="#0000CC">$im</font><font color="#006600">, </font><font color="#0000CC">5</font><font color="#006600">, </font><font color="#0000CC">182</font><font color="#006600">, </font><font color="#0000CC">167</font><font color="#006600">, </font><font color="#CC0000">"$b"</font><font color="#006600">, </font><font color="#0000CC">$im</font><font color="#006600">-</font><font color="#0000CC">10</font><font color="#006600">);
</font><font color="#0000CC">ImageString</font><font color="#006600">(</font><font color="#0000CC">$im</font><font color="#006600">, </font><font color="#0000CC">5</font><font color="#006600">, </font><font color="#0000CC">181</font><font color="#006600">, </font><font color="#0000CC">166</font><font color="#006600">, </font><font color="#CC0000">"$b"</font><font color="#006600">, </font><font color="#0000CC">$im</font><font color="#006600">-</font><font color="#0000CC">250</font><font color="#006600">);

</font><font color="#0000CC">ImageJpeg</font><font color="#006600">(</font><font color="#0000CC">$im</font><font color="#006600">);
</font><font color="#0000CC">?></font>
</font>
</code>

 

?

Link to comment
Share on other sites

1) piesleedzam extensionu iconv - izlasiit ieksh php.net par specifiskaam lietaam

2) $res = iconv('windows-1257', 'utf-8', $src);

3) $img = imagecreate(...); imagettftext($img, 'arial.ttf', ..., $res);

4) baazkurgribi($img);

 

mineetaa metode darbojas arii ar .ru burtiem, kaa arii ar visiem citiem, kurus atbalsta izmantojamais fonts.

 

veseli eedushi :)

Link to comment
Share on other sites

  • 3 weeks later...
×
×
  • Create New...