Commit Graph

64 Commits

Author SHA1 Message Date
Werner Lemberg b1c8bf0683 Minor formatting.
Adding copyright/C++ guards to psaux files.
2000-08-17 07:18:04 +00:00
David Turner 24d7024c44 added draft "psaux" code
the t1 driver now reads the complete font matrix

and applies it (some fonts do not work properly without
hinting though...)
2000-08-17 01:09:06 +00:00
David Turner 710354b8e9 fixed the bug that prevented bitmap formats to be loaded
correctly when the auto-hinter is used (symptom: "winfonts"
driver didn't load bitmaps correctly).
2000-08-16 17:04:22 +00:00
Werner Lemberg 05c21b8f3d Formatting. 2000-07-29 20:38:19 +00:00
Just van Rossum e97cb9127d FT_Done_Stream(): do stream->close = 0 after calling stream->close(); this makes it safe to call FT_Done_Stream() more than once.
David: please review this; I hope you agree with this minor change.
2000-07-28 03:13:31 +00:00
Just van Rossum 9e830c5d3f Put FT_New_Face() in an #ifndef macintosh switch; ftmac.c provides an extended implementation. 2000-07-28 01:12:34 +00:00
Werner Lemberg 58b17f9647 Formatting. 2000-07-27 23:29:08 +00:00
David Turner c5cdf8bcf1 re-adding a "unix-dev.mk". Debugging libtool output
is just too much of a pain for me, I prefer a good old
static lib without optimizations :-)

"make devel" is back on Unix then..
2000-07-27 21:40:22 +00:00
Werner Lemberg d060a75b0d Formatting.
Rudimentary support for autoconf (still using GNU make)

Say `make unix'.
2000-07-20 06:57:41 +00:00
David Turner c49f69cb8c some welcome fixes related to the auto-hinter:
- removed a stupid memory leak

  - fixed the weird metrics hinting (the horizontal edges were used,
    instead of the vertical one, to compute the metrics adjustments,
    silly, silly, silly).

there is still some bugs that I'm looking at though, but we're
very near the release..
2000-07-20 03:44:50 +00:00
David Turner 6930b45f78 - introduced FT_Get_Glyph_Name (see freetype.h)
to access individual glyph names. Changed some
  drivers to support it through a new interface named
  "glyph_name".

- introduced FT_Get_Sfnt_Name (see ftnames.h)
  to access the SFNT name table in a TrueType/OpenType
  file..
2000-07-19 17:13:03 +00:00
Werner Lemberg 5aa646c565 Formatting.
Fixing a bug in FT_Get_Kerning().

Moving FT_Get_Module_Interface() to ftoutln.c.
2000-07-14 06:16:47 +00:00
Werner Lemberg 2405d14f77 Formatting/Synchronizing.
Updating OS/2 bits in ttnameid.h to latest version (as posted on the
opentype@ list).
2000-07-11 06:12:20 +00:00
Werner Lemberg 93ac3e3985 Formatting.
Synchronizing docs.
2000-07-10 21:41:32 +00:00
Werner Lemberg b48a6094b2 Formatting.
Moving some internal structures and constants from freetype.h to ftobjs.h.

Finally removing FT_LOAD_ANTI_ALIAS.

Cleaning up all error codes.  Only the used ones have survived :-)

Removed unused FT_MAX_GLYPH_FORMATS constant.

T2 error codes are now in the range 0x500-0x5FF (instead of `TrueDoc').

Some minor improvements of error return values.

Finally fixing error code values in ftraster and ftgrays to be compliant
with all other FT error codes.
2000-07-09 19:15:30 +00:00
Werner Lemberg 7fa51b5535 Formatting.
Adding some trivial error checking.

Adding/Fixing tracing levels.
2000-07-08 19:51:42 +00:00
David Turner 9b3d1c75ad - fixed a leak in the Type 1 driver
- updated the CFF driver to support flex opcodes
2000-07-07 19:47:34 +00:00
Werner Lemberg bd5ae40006 Run g++ on the FreeType library. This should make the use of code in
C++ programs easier:

  Renamed FT_WordXX to FT_UIntXX.

  Changed a lot of void* to FT_Byte* if related to i/o streams -- FreeType
  always accesses streams byte-wise, so this makes sense IMHO.

  Added a lot of #ifdef __cplusplus to header files (and removed a few).

  Other minor syntax fixes (mostly casts).

  Replaced the variable `private' with `private_dict' -- `private' is
  reserved in C++.
2000-07-05 04:32:02 +00:00
Werner Lemberg fbeb41d93d Formatting.
Adding copyright notices.

Removing an unnecessary file (smooth.h).
2000-07-02 00:27:53 +00:00
Werner Lemberg a8bbc267a2 Formatting as usual...
Adding trivial argument checking to some functions.

Added dynamic driver interface to cidriver.

Minor `version' fixes for macfont and psnames modules.

Removed unnecessary files
2000-07-01 14:06:46 +00:00
David Turner f9ca2bb58a managed to re-design entirely the API in <freetype/ftglyph.h>
It is now really the "glyph factory" that Stefan was probably
dreaming about..

fixed some recent formatting errors from Werner ;-)

cleaned up the demonstration programs from most of the
rust that they had, though I'm sure someone is going to
re-format them really soon !!

"ftstring" now uses the new ftglyph.h API, and is now
faster and smaller.. yep..
2000-06-30 23:12:55 +00:00
Werner Lemberg cc9fc49c90 Formatting...
Applying some fixes from Tom.
2000-06-30 06:21:26 +00:00
David Turner 5ae831c101 changes used to implement the auto-hinting support 2000-06-30 01:31:22 +00:00
Werner Lemberg deb4e98396 Formatting...
Preprocessor lines now always start the line.

Improved error handling in `base' module.

Fixed a out-of-bounds error in ttgload.
2000-06-29 03:14:25 +00:00
David Turner 81bb4ad937 latest clean-ups..
The code compiles with NO WARNINGS with GCC and
Visual C++ (also with LCC minus debugging options)
2000-06-28 04:19:49 +00:00
David Turner 74abee8e2e various cleanups to reduce compiler warnings 2000-06-27 23:31:53 +00:00
Werner Lemberg dcd2e14c58 forgotten fixes. 2000-06-25 07:43:15 +00:00
Werner Lemberg a929ba9b20 applying formatting again 2000-06-25 06:47:11 +00:00
David Turner 2a98b3c431 reduced some nasty memory leaks 2000-06-23 13:47:55 +00:00
David Turner f0df85ba2a - MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
    source in order to provide the following enhancements:

      - more generic module support:

        The FT_Module type is now defined to represent a handle to a given
        module. The file <freetype/ftmodule.h> contains the FT_Module_Class
        definition, as well as the module-loading public API

        The FT_Driver type is still defined, and still represents a pointer
        to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
        FT_Get_Driver by FT_Get_Module, etc..


      - support for generic glyph image types:

        The FT_Renderer type is a pointer to a module used to perform various
        operations on glyph image.

        Each renderer is capable of handling images in a single format
        (e.g. ft_glyph_format_outline). Its functions are used to:

           - transform an glyph image
           - render a glyph image into a bitmap
           - return the control box (dimensions) of a given glyph image


        The scan converters "ftraster.c" and "ftgrays.c" have been moved
        to the new directory "src/renderer", and are used to provide two
        default renderer modules.

        One corresponds to the "standard" scan-converter, the other to the
        "smooth" one.

        The current renderer can be set through the new function
        FT_Set_Renderer.

        The old raster-related function FT_Set_Raster, FT_Get_Raster and
        FT_Set_Raster_Mode have now disappeared, in favor of the new:

           FT_Get_Renderer
           FT_Set_Renderer

        see the file <freetype/ftrender.h> for more details..

        These changes were necessary to properly support different scalable
        formats in the future, like bi-color glyphs, etc..


      - glyph loader object:

        A new internal object, called a 'glyph loader' has been introduced
        in the base layer. It is used by all scalable format font drivers
        to load glyphs and composites.

        This object has been created to reduce the code size of each driver,
        as each one of them basically re-implemented its functionality.

        See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
        more information..



      - FT_GlyphSlot had new fields:

        In order to support extended features (see below), the FT_GlyphSlot
        structure has a few new fields:

           linearHoriAdvance:  this field gives the linearly scaled (i.e.
                               scaled but unhinted) advance width for the glyph,
                               expressed as a 16.16 fixed pixel value. This
                               is useful to perform WYSIWYG text.

           linearVertAdvance:  this field gives the linearly scaled advance
                               height for the glyph (relevant in vertical glyph
                               layouts only). This is useful to perform
                               WYSIWYG text.

        Note that the two above field replace the removed "metrics2" field
        in the glyph slot.

           advance:   this field is a vector that gives the transformed
                      advance for the glyph. By default, it corresponds
                      to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
                      was specified when calling FT_Load_Glyph or FT_Load_Char

           bitmap_left: this field gives the distance in integer pixels from
                        the current pen position to the left-most pixel of
                        a glyph image WHEN IT IS A BITMAP. It is only valid
                        when the "format" field is set to
                        "ft_glyph_format_bitmap", for example, after calling
                        the new function FT_Render_Glyph.

           bitmap_top:  this field gives the distance in integer pixels from
                        the current pen position (located on the baseline) to
                        the top-most pixel of the glyph image WHEN IT IS A
                        BITMAP. Positive values correspond to upwards Y.

           loader:  this is a new private field for the glyph slot. Client
                    applications should not touch it..


      - support for transforms and direct rendering in FT_Load_Glyph:

        Most of the functionality found in <freetype/ftglyph.h> has been
        moved to the core library. Hence, the following:

          - a transform can be specified for a face through FT_Set_Transform.
            this transform is applied by FT_Load_Glyph to scalable glyph images
            (i.e. NOT TO BITMAPS) before the function returns, unless the
            bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..


          - once a glyph image has been loaded, it can be directly converted to
            a bitmap by using the new FT_Render_Glyph function. Note that this
            function takes the glyph image from the glyph slot, and converts
            it to a bitmap whose properties are returned in "face.glyph.bitmap",
            "face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
            native image might be lost after the conversion.


          - when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
            and FT_Load_Char functions will call FT_Render_Glyph automatically
            when needed.
2000-06-22 00:17:42 +00:00
Werner Lemberg e35cac66c6 A complete revision of FreeType 2's GNU makefiles (of the library):
Tons of unnecessary stuff have been removed; only the essential rules
  have been retained.

  The source files now depend on all header files in include/freetype,
  include/freetype/config, and include/freetype/internal.  This is not
  optimal, I know, and I'll try to improve this, but it is better than
  before (namely no dependencies on `internal').

  FTDEBUG_SRC has been added (similar to FTSYS_SRC) -- I don't know
  exactly whether this is really useful, but it doesn't harm.

  There is now more documentation in the makefiles itself.

io-frames.html: Use of <th>, <code>, and <var> for better tagging.

Reactivating of FT_DEBUG_LEVEL_xxx macros.

Added a lot of #include directives to make `multi' builds possible -- note
that currently the modules cid, t1, and t1z have clashing structures and
functions which means that you can only use one of these three modules for a
multi build.

Added some missing function declarations to (local) header files.

Renamed some T1_Open_Face() to CID_Open_Face() in the cid module -- a lot
of other functions should be renamed also...

Replaced many FT_xxx stuff with T1_xxx in t1z driver -- this isn't finished
yet...

Fixed FT_Free() to allow a NULL pointer without an assertion (this has
always been a valid assumption in FreeType, at least in FT 1.x).

A lot of other, minor fixes (mostly documentation).
2000-06-11 03:46:57 +00:00
Werner Lemberg 4e6dd8587e freetype.h: Adding ft_encoding_xxx values for some CJK encodings.
Fixing copyright notice on many files.

Changed some tracing levels.

A lot of formatting, fixing documentation etc. as usual.
2000-06-05 05:26:15 +00:00
Werner Lemberg 5617726108 ftview now has two new options: -d activates debugging, and -l sets the
trace level.

Since FT2 is still beta, I've activated the FT_DEBUG_xxx macros by default.

To make reasonable output, I've changed some TRACEx macros to other levels.
2000-06-03 21:59:44 +00:00
Werner Lemberg eb81e37825 More preparation for tracing. Formatting. 2000-06-03 06:03:11 +00:00
Werner Lemberg 91e52d416a Finishing first formatting/documenting etc. of the `base' dir. Some modules
are still badly documented, though...
2000-06-02 14:30:38 +00:00
Werner Lemberg 2fbf7e439f Added a lot of error checking code to the exported functions in the `base'
subdir (not complete yet).
2000-06-02 00:01:14 +00:00
Werner Lemberg a3b6c6c290 Formatting, fixing and adding documentation. 2000-05-31 06:55:12 +00:00
David Turner 1118720679 finalised the multiple masters support
fixed some nasty little bugs too
2000-05-26 17:13:23 +00:00
David Turner fea68c6800 fixed two minor bugs:
- the glyph index was not checked in FT_Load_Glyph
  - the "type1" driver didn't read the FontBBox and FontMatrix
    correctly..
2000-05-26 06:40:49 +00:00
David Turner 1fb6eea7d1 EXPORT_DEF renamed to FT_EXPORT_DEF +
reformating/spacing
2000-05-24 00:31:14 +00:00
David Turner 51179f0ae3 some fixes for 64-bit systems. Mainly changed some
FT_TRACE calls to use %p instead of %lx when dumping
a pointer address
2000-05-18 16:18:05 +00:00
David Turner e49ab25c08 formatting - removed trailing spaces 2000-05-16 23:44:38 +00:00
David Turner 0a29c6979d implemented FT_Select_Charmap and FT_Set_Charmap
(at last :-)
2000-05-12 17:09:38 +00:00
David Turner bfe2f98f1f a new massive grunt work. Redefined the EXPORT_DEF,
EXPORT_FUNC, BASE_DEF and BASE_FUNC macros to
let them take an argument..

This is needed to compile the library as a DLL on some platforms
that have different compiler conventions..
2000-05-12 12:17:15 +00:00
David Turner 4f2c5544bb additional changes, this time in order to pass extra parameters
to font drivers when creating a new face object.

The FT_Open_Args structure has been changed to simplify
its use and allow generic parameters too..
2000-05-12 10:19:41 +00:00
David Turner efce08d67c major re-organisation of the FreeType 2 directory hierarchy 2000-05-11 18:23:52 +00:00
David Turner c1205799f5 changes the type of the "mode" parameter in FT_Set_Raster_Mode
to unsigned long (easier than string to compare)
2000-05-05 01:38:46 +00:00
David Turner a8bcdf8ef6 added FT_Done_Stream 2000-05-02 10:51:41 +00:00
David Turner 99a4d93b2d added FT_Get_Sfnt_Table from "include/tttables.h" 2000-04-25 16:10:50 +00:00
David Turner 37379e2170 major changes to the library:
- there is now a "convenience" API to manage glyphs in
   "include/ftglyph.h". See the demo program "ftstring" for
   an example..

  - the raster interface has been changed in order to allow
    direct composition through user-provided callbacks. This
    has been tested but isn't demonstrated for now in "demos"

 - the FT_LOAD_NO_RECURSE flag is supported, as this is
   required by some new code in the auto-hinting engine

 - some bug fixed in FT_MulFix which made FT_xxx_Transform
   return incorrect results..
2000-03-28 11:22:31 +00:00