Pango API feedback



     Hello,
	Below are some minor/nitpick comments I have after my first brief
look at the Pango API.  Not to be taken too seriously :)

	After I've had a chance to write some code and dink with it some
more, I might have some more substantial comments...



Function names:
---------------
pango_context_get_base_dir()
pango_context_set_base_dir()

        Since this is listed right after the _font_description()
functions, "base dir" made me think of "base directory".  It's not a real
effort to look it up, but it seems to me that the extra 6 characters
"ection" would make it a little more intuitive.  Suggested names:

        pango_context_get_base_direction()
        pango_context_set_base_direction()


Return values:
--------------
void pango_context_list_families()
void pango_context_list_fonts()

        Is there any reason these return void and require a pointer to an
array of pointers?  It would seem much easier to simply return a GList of
gchar* font families and PangoFontDescriptions, respectively.  Then you
wouldn't need the special _free() functions, either (would you?).

        Also, it would be useful if NULL could be used as an out-of-band
error condition specifier (as a return value).


API Return Values: void functions

        Why do some of the functions have a void return value, when they
give back a single value?  For example, why does
pango_glyph_string_index_to_x() take a pointer to an int instead of just
returning an int?  Why does pango_glyph_string_extents() take a pointer to
a PangoRectangle instead of just returning a PangoRectangle?  Seems
inconsistent throughout the API...


Arguments:
----------
API Arguments: const gchar *text

        "gchar" is supposed to be a system-independent abstraction of the
single character datatype.  For some future Unicode-native operating
system, that might actually be a 16-bit or 32-bit value (in UCS-2 or
UCS-4).  Since this API specifically takes UTF-8 encoded strings, I think
"const gchar *text" should be replaced with "const guint8 *text" in the
functions.  It would also make it clear that it's a UTF-8 argument, not a
one-byte-per-character ASCII argument.



--Derek






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]