Commit Graph

81 Commits

Author SHA1 Message Date
Behdad Esfahbod 20c8b908dd Finish off previous change 2011-05-12 15:19:33 -04:00
Behdad Esfahbod 0fd8c2f1be [API] Make get_glyph() callback return a boolean
We need to know whether the glyph exists, so we can fallback to
composing / decomposing.  Assuming that glyph==0 means "doesn't exist"
wouldn't work for applications like Pango that want to use different
"doesn't exist" glyph codes for different characters.  An explicit
return value fixes that.
2011-05-12 15:14:13 -04:00
Behdad Esfahbod 805af72405 Rename get_kernings() arguments from first/second_glyph to left/right_glyph
Makes it clear that kerning is in visual order.
2011-05-12 12:39:40 -04:00
Behdad Esfahbod 52df150efe Fix font subclass chainup
Test passing now.
2011-05-12 00:46:57 -04:00
Behdad Esfahbod 7033518f75 [API] Pass face to get_table() 2011-05-11 23:31:15 -04:00
Behdad Esfahbod b467827806 [API] Remove const from font user_data 2011-05-11 23:25:28 -04:00
Behdad Esfahbod 9a14688e40 [API] Rename hb_face_create_for_data() to hb_face_create() 2011-05-11 22:49:29 -04:00
Behdad Esfahbod 80a6833b03 [API] Add hb_*_get_empty() for all objects 2011-05-11 18:21:58 -04:00
Behdad Esfahbod a513dbcf73 [API] Change signature of get_contour_point and get_kerning ffuncs
get_contour_point now takes glyph id before point_index.

get_kerning now takes a vector to fill-in.
2011-05-11 00:38:22 -04:00
Behdad Esfahbod 63d646fb29 [font] Do user-space conversion when chaining up to parent font 2011-05-11 00:15:37 -04:00
Behdad Esfahbod abcfe9b59b Remove hb_ot_layout_context_t, simplify code 2011-05-11 00:02:02 -04:00
Behdad Esfahbod 1ded6d8bbf Make default font-funcs chain-up to the parent 2011-05-10 20:50:06 -04:00
Behdad Esfahbod b9d975b931 [API] Pass down closure user_data to font funcs 2011-05-10 20:41:13 -04:00
Behdad Esfahbod 686c2d165d [API] Remove font_funcs func getter functions 2011-05-10 20:04:26 -04:00
Behdad Esfahbod defc45be6d [API] Add hb_font_create_sub_font() and hb_font_get_parent()
Not quite useful just yet.
2011-05-10 20:02:49 -04:00
Behdad Esfahbod 85e6218e33 [API] Remove broken-by-design hb_font_unset_funcs() 2011-05-10 19:40:44 -04:00
Behdad Esfahbod 74f1d896f2 Add hb_font_make/is_immutable() 2011-05-10 19:39:32 -04:00
Behdad Esfahbod 1c9f8717eb [API] Simplify blob API, remove lock 2011-05-06 22:59:42 -04:00
Behdad Esfahbod 56eb5ad6f9 Move code around
Mutex (and Windows.h by extension) are fairly isolated now.
2011-05-04 19:27:37 -04:00
Behdad Esfahbod 266b34418c Refactor to keep hb-object-private.h and hb-open-type.h separate
Needed to be able to include <Windows.h> from hb-object-private.h.
2011-05-03 00:35:53 -04:00
Behdad Esfahbod 72657e4ce7 [API] Make hb_font_create() take a face and reference it 2011-05-02 20:47:23 -04:00
Behdad Esfahbod cec6611c5c Protect NULL in a couple places 2011-05-02 20:18:58 -04:00
Behdad Esfahbod 4911062d5b [API] Rename hb_blob_create_empty() to hb_blob_get_empty() 2011-05-02 19:36:39 -04:00
Behdad Esfahbod 1ab1d3e38c [face] Return nil face if blob is inert 2011-05-02 19:35:53 -04:00
Behdad Esfahbod c7ffe2ad5f [API Remove hb_font_funcs_copy()
Will be adding font_funcs subclassing instead.
2011-04-28 16:03:29 -04:00
Behdad Esfahbod 5fa849b77d [API] Add _set/get_user_data() for all objects 2011-04-27 21:46:01 -04:00
Behdad Esfahbod 47e71d9661 [object] Remove unnecessary use of macros 2011-04-27 16:41:08 -04:00
Behdad Esfahbod fca368c468 Add hb_object_header_t which is the common part of all objects
Makes way for adding arbitrary user_data support.
2011-04-21 18:24:02 -04:00
Behdad Esfahbod 2409d5f8d7 Update Copyright headers 2011-04-21 17:14:28 -04:00
Behdad Esfahbod da97541988 [API] Allow negative font x_scale/y_scale
I was reconsidering whether y should grow down, since all three/four
times I've used this API I was tricked and got that wrong in my use.
So I was very inclined to make y grow down instead of up.  However,
considering that the font space has y up and it would be very confusing
for callbacks to work against that, I decided that what I really want
is for the user to be able to set y_scale to a negative number to imply
that user-space y grows down.

Changing x_scale/y_scale from unsigned int to int allows that, and I've
made pango to use that instead of negating glyph y_offset later.  hb-ft
however still has y group up.  I *guess* that's how FreeType works?
I'm not sure, FreeType docs don't make this clear...

I'm happy with the resolution :-).
2011-04-21 15:15:02 -04:00
Behdad Esfahbod c57d454acc Rename all private sources and headers to C++ files
So we can liberally use the simple features of C++ that parts of the
codebase is already using.
2011-04-20 18:50:27 -04:00
Behdad Esfahbod 9417c1c0d2 [API] Make hb_face_reference_table() return empty blob instead of NULL
The idea here is that:

  - Like pretty much all other API in harfbuzz, user does not have to
    check for NULL.

  - In any caller code, the case of missing table should be handled
    exactly the same way that a too-short table is handled.  Turning
    a non-existent talbe into a table of size 0 makes the user code
    safer.
2011-04-20 17:21:23 -04:00
Behdad Esfahbod c035812feb [API] Rename hb_face_get_table() to hb_face_reference_table()
That correctly reflects the reference ownership transfer happening.
2011-04-20 17:03:00 -04:00
Behdad Esfahbod af02933739 [API] Remove hb_*_get_reference_count()
This was a bizzare piece of API that I inherited from cairo.  It has
been wrong adding them to cairo in the first place.  Remove them before
someone uses them!
2011-04-20 15:49:31 -04:00
Behdad Esfahbod 5668189c12 [API] font: move user_data before destroy()
This is the common convention for language binding tools.
2011-04-20 03:03:32 -04:00
Behdad Esfahbod 502f4cba3e Divide get_metrics into get_advance and get_extents
Graphite module not updated.
Bump version to 0.3.
2010-10-27 01:13:56 -04:00
Behdad Esfahbod ec6c0e54d3 Fix blob leak 2010-10-26 11:28:14 -04:00
Behdad Esfahbod 3111b8a0d5 Fix stupid bug, oops 2010-10-13 10:41:53 -04:00
Behdad Esfahbod e81d7afe6e Add hb_face_get_upem() 2010-10-04 18:18:48 -04:00
Behdad Esfahbod 645f6f265b Add is_mutable() functions
Correspond to the make_mutable() ones.
2010-10-04 17:01:01 -04:00
Behdad Esfahbod 19c0eab8cf Add getters for all setter APIs
One in particular is not a straight getter: hb_font_unset_funcs() is
special because of the specific needs of the lifecycle management of
the user_data object.
2010-10-04 16:45:21 -04:00
Behdad Esfahbod 8e577acae2 Fix blob refcounting with insane SFNT table directories 2010-09-22 17:37:02 -04:00
Behdad Esfahbod acdba3f90b Prefer C linkage 2010-07-23 15:39:27 -04:00
Behdad Esfahbod cc6d52279d De-C++ where possible
Helps with avoiding many "extern C" declarations in source files.
2010-07-23 15:00:13 -04:00
Behdad Esfahbod f97bf4f812 Make sure we initialize all callbacks upon creation
Also fixes issue with unicode callbacks never being set really.
2010-05-24 17:50:19 +01:00
Behdad Esfahbod bf36a1074a Move all callback functions in a vtable structs 2010-05-24 17:46:21 +01:00
Behdad Esfahbod 280af1bddb Let hb_face_get_table() return NULL if table not found 2010-05-20 18:33:35 +01:00
Behdad Esfahbod 750a229455 get_table() is allowed to return NULL. Use that to simplify code 2010-05-20 16:23:27 +01:00
Behdad Esfahbod 99d9ef785f Write hb_face_create_for_data() in terms of hb_face_create_for_tables()
Fixes lack of head_table initialization in create_for_tables() also.
2010-05-20 15:47:49 +01:00
Behdad Esfahbod 0a4399ca22 Fix scale issues
hb_font_set_scale() now sets the value to be used to represent a unit
pixel.  For example, if rendering a 10px font with a 26.6 representation,
you would set scale to (10 << 6).  For 10px in 16.16 you would set it to
(10 << 16).  This space should be the same space that the get_glyph_metrics
and get_kerning callbacks work in.
2010-05-19 15:45:06 -04:00