473,320 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

TrueType bytecode support

Ben
Does anyone have any experience using the TrueType bytecode interpreter
to display fonts in PHP under Windows? I'm running Windows XP, PHP
4.3.11, GD 2.0.28 with FreeType enabled. It all works fine, but it's
using the FreeType anti-aliased hinting rather than the clear Windows
non-antialiased (bytecode interpreter?) hinting.

I'm looking into converting my weather graph generator (at
http://harvest.com/w.cgi), which now uses the Win32 API to draw the
fonts, to use PHP and the GD library. To see a comparison of what I'm
getting now with the FreeType non-anti-aliased and anti-aliased
versions, check out http://harvest.com/images/truetype.png

Obviously the first (Win32 API) is the best. The second is yucky. The
last would do, but it doesn't look as nice IMHO, and produces bigger
output because it needs lots of extra colours.

I'm aware of the patent issues. I've tried recompiling FreeType with
bytecode support (as per http://www.tldp.org/HOWTO/Font-HOWTO/bci.html)
and that worked, but I realised I'd need to compile GD and libpng and
and all the rest, which I can't do at the moment.

Any ideas? Is there a Win32 version of PHP_GD2.DLL with the FreeType
bytecode interpreter enabled?

Oct 5 '05 #1
4 2197
"Ben" wrote:
Does anyone have any experience using the TrueType bytecode interpreter
to display fonts in PHP under Windows? I'm running Windows XP, PHP
4.3.11, GD 2.0.28 with FreeType enabled. It all works fine, but it's
using the FreeType anti-aliased hinting rather than the clear Windows
non-antialiased (bytecode interpreter?) hinting.


Maybe I'm wrong, but it looks to me like your Windows system is using a
bitmap screen font rather than relying on byte codes to correct the glyph
shapes. Try installing a fixed point size (bitmap only) font in your server
and see if that helps.

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Oct 5 '05 #2
Ben
Thanks, Phil. Hmm, yes, that's possible. But my "server" is just my
development PC, so I'm using exactly the same font file for all three
images.

That said, if there's an easy way to make a fixed point size font from
a TrueType font, I could solve it. Any ideas?

Oct 11 '05 #3
"Ben" wrote:
Thanks, Phil. Hmm, yes, that's possible. But my "server" is just my
development PC, so I'm using exactly the same font file for all three
images.

That said, if there's an easy way to make a fixed point size font from
a TrueType font, I could solve it. Any ideas?


Apparently FreeType 2 supports SFNT-based bitmap fonts:
<http://freetype.sourceforge.net/freetype2/index.html>

Which version are you running at the moment? (run phpinfo() to find out)

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Oct 11 '05 #4
Ben
I'm running PHP version 4.3.11, bundled GD version (2.0.28 compatible),
and it doesn't say what FreeType version, but I'm almost certain it's
FreeType 2. I just discovered the two functions imagettftext() and
imagefttext(), the latter of which (according to the PHP docs) is
supposed to use FreeType 2. But they both work and look exactly the
same on my system.

As for SFNTs, are they the embedded fixed point size bitmaps in
TrueType fonts? I downloaded a Microsoft utility SBIT32, which is
supposed to extract bitmap fonts from TrueType fonts. Looked very
hopeful, but it said all the fonts I tried (Verdana, Arial, and others)
didn't have bitmaps in them. See:
http://www.microsoft.com/typography/tools/tools.htm

So maybe the hinting is done in such a way now that they don't need
bitmaps at small sizes. I don't know.

Thanks again for your time,
Ben.

Oct 11 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jamie Davison | last post by:
I'm have GD 2.0.1 - php 4.3.5 compiled --with-gd--enable-gd-native-ttf--enable-gd-jis-conv --with-freetype-dir=/usr/local' '--with-t1lib=/usr/local...
1
by: Ralph Yozzo | last post by:
Hi, Does anyone know of a good place to look for a starting point -- I'm building an application on J2ME and I want to have a scripting language to both access my UI and the database RMS. Most...
46
by: Jon Perez | last post by:
Can one run a 1.5 .pyc file with the 2.x version interpreters and vice versa? How about running a 2.x .pyc using a 2.y interpreter?
6
by: Benjamin Scherrey | last post by:
I'm curious as to how difficult it would be to take a string that contains compiled bytecode, load it into memory, give it a function name then execute that function. I'm thinking of a database...
33
by: Maurice LING | last post by:
Hi, I've been using Python for about 2 years now, for my honours project and now my postgrad project. I must say that I am loving it more and more now. From my knowledge, Python bytecodes are...
0
by: Andrew Lambert | last post by:
Hi, I've been trying to compile perl scripts into bytecode. Now, from what I understand I can use either perlcc -B script.pl or perl -MO=bytecode script.pl to do this (whats the difference...
0
by: Joshua T. Moore | last post by:
I must print with a non-TrueType font for the printer to do specific features. I P/Invoked CreateFont to get the (IntPtr) handle of the font, but System.Drawing.Graphics.DrawString's...
11
by: Michael Spencer | last post by:
Announcing: compiler2 --------------------- For all you bytecode enthusiasts: 'compiler2' is an alternative to the standard library 'compiler' package, with several advantages. Improved...
4
by: kwatch | last post by:
Hi, It is possible to get bytecode from code object. Reversely, is it possible to create code object from bytecode? ex. ## python code (not a module) pycode = '''\ print "<ul>\n" for item...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.