summaryrefslogtreecommitdiff
path: root/pango/pango-attributes.c
Commit message (Collapse)AuthorAgeFilesLines
* Use PANGO_FONT_MASK_* not PANGO_ATTR_* when manipulating the mask. AddOwen Taylor2001-09-281-14/+15
| | | | | | | | | | Fri Sep 28 11:27:57 2001 Owen Taylor <otaylor@redhat.com> * pango/pango-attributes.c (pango_attr_iterator_get_font): Use PANGO_FONT_MASK_* not PANGO_ATTR_* when manipulating the mask. Add fields to mask for PANGO_ATTR_FONT_DESC so it won't be overwritten by later attributes. (Fixes from Tony Graham, #61297)
* Up to 0.19.Owen Taylor2001-09-181-80/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tue Sep 18 15:47:08 2001 Owen Taylor <otaylor@redhat.com> * configure.in (PANGO_MINOR_VERSION): Up to 0.19. * pango/pango-font.h pango/pango-fontmap.[ch] pango/fonts.c pango/pangoxft-fontmap.c pango/pangoft-fontmap.c pango/pango-context.[ch] pango/pangox-fontmap.c: Add new PangoFontFace and PangoFontFamily object types, and change the font listing API to list faces and families, instead of face names and font descriptions. * pango/pango-font.h pango/fonts.c: Make PangoFontDescription an opaque heap-allocated structure, add accessors and convenience functions. * pango/pango-font.h pango/pango-private.h: Make PangoFontMetrics heap allocated, protect the structure definition with #ifdef PANGO_ENABLE_BACKEND, and add getters for the fields. * pango/pango-attributes.[ch] ( pango_attr_iterator_get_font): instead of providing a base font description and one to fill in, provide a single font description to modify based on the attributes. * pango/pango-attributes.[ch]: Fix PangoAttrFontDesc to have a PangoFontDescription by reference, not by value. * pango/pango-utils.[ch]: make pango_parse_style() and friends take pointers to individual enumerations instead of to a PangoFontDescription structure. * pango/*.c: Fix for the PangoFontDescription and PangoFontMetrics changes. * pango/pango-{break,engine,indic,ot,xft}.h pango/Makefile.am pango/opentype/Makefile.am: Protect portions with PANGO_ENABLE_ENGINE to shrink the public API. * modules/*/Makefile.am: -DPANGO_ENABLE_ENGINE. * pango/{pangox.h,pangox-private.h} modules/basic/basic-x.c: Move pango_x_font_get_unknown_glyph() into public header since it is used from modules. * pango/pango-{context,font,fontmap,modules.utils}.h pango/Makefile.am: Protect portions with PANGO_ENABLE_BACKEND to shrink the public API. * pango/*.h: Use G_BEGIN/END_DECLS * examples/viewer-qt.[cc,h]: Fix for changes to font listing API, PangoFontDescription. * pango/pango-indic.h modules/indic/*: Since we install this header fix it up to Pango conventions, namespece ZERO_WIDTH_JOINER, ZERO_WIDTH_NON_JOINER. * docs/pango-sections.txt: Updated.
* Update to the new g_boxed_type_register_static API.Alex Larsson2001-09-101-3/+1
| | | | | | | | | | | | 2001-09-10 Alex Larsson <alexl@redhat.com> * pango/fonts.c: * pango/glyphstring.c: * pango/pango-attributes.c: * pango/pango-color.c: * pango/pango-tabs.c: * pango/pango-utils.c: Update to the new g_boxed_type_register_static API.
* New file, move color handling here.Owen Taylor2001-08-301-54/+0
| | | | | | | | | | | Thu Aug 30 17:34:52 2001 Owen Taylor <otaylor@redhat.com> * pango/pango-color.c: New file, move color handling here. * pango/pango-attributes.[ch] pango/pango-markup.c pango/pango-color.c: Export pango_color_parse, change it to take a PangoColor as its argument.
* Remove stray semicolon.Darin Adler2001-07-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * modules/arabic/arabic-x.c: (arabic_engine_shape): Remove stray semicolon. * modules/arabic/arconv.h: * modules/arabic/arconv.c: (shape), (doublelig), (arabic_reshape): Use long* instead of int* for parameter to match what's passed in. * modules/indic/bengali-x.c: Add missing <string.h> include. (pango_indic_make_ligs): Use local variable that was added but not ever used. (pango_indic_engine_shape): Remove unused locals. * modules/indic/devanagari-x.c: Add missing <string.h> include. (pango_indic_engine_shape): Remove unused local. * modules/indic/gujarati-x.c: Add missing <string.h> include. (pango_indic_engine_shape): Remove unused local * modules/tamil/tamil-x.c: (tamil_engine_shape): Initialize a variable to quiet the compiler's unused warning. * pango/.cvsignore: Ignore more generated files. * pango/opentype/ftxgpos.c: (Get_Anchor): Add code to set up the ap variable. The old code would just use the uninitialized value. * pango/opentype/ftxopen.c: (Load_Coverage): Remove unused local. * pango/opentype/pango-ot-ruleset.c: (pango_ot_ruleset_shape): Remove unused local. * pango/pango-attributes.c: (pango_attr_list_get_type), (pango_color_get_type): Add needed function type casts (just warnings under gcc, but could be errors in other compilers). * pango/pangoxft-font.c: (pango_xft_font_get_metrics), (pango_xft_font_get_coverage), (pango_xft_get_shaper_map), (pango_xft_font_find_shaper): Switch from lang char* to PangoLanguage*. The code was still compiling, but would not have worked.
* Add a new PangoLanguage type to represent language tags; these canOwen Taylor2001-06-141-21/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sat Jun 9 17:36:09 2001 Owen Taylor <otaylor@redhat.com> * pango/pango-types.h pango/pango-utils.c: Add a new PangoLanguage type to represent language tags; these can efficiently be compared and don't need to be copied. Also add pango_language_matches() to match a language tag against a pattern. * pango/pango-item.[ch] pango/pango-layout.c: Move extra_attrs from PangoItem to PangoAnalysis. Add a language tag field to PangoAnalysis. (#55894) * pango/pango-attributes.[ch] (pango_attr_iterator_get_font): Return the language tag as well. * pango/pango-attributes.[ch]: Rename PangoAttrLang to PangoAttrLanguage, and make it hold a PangoLanguage. * pango/pango-context.[ch]: Rename pango_context_{get,set}_lang() to pango_context_{get,set}_language(). * **.[ch]: Adapt to PangoLanguage and s/lang/language/ changes. * modules/basic/basic-x.c modules/basic/tables-big.i: Add support for ordering character sets differently for different language tags. * pango/itemize.c: Remove old, unused file. * pango/pango-context.c (pango_itemize): Reduce number of mallocs by allocating one array of PangoAnalysis instead of many arrays.
* Removed pango_justify(), since it has no implementation that I can find.Havoc Pennington2001-04-171-1/+18
| | | | | | | | | | | 2001-04-16 Havoc Pennington <hp@pobox.com> * pango/pango-glyph.h: Removed pango_justify(), since it has no implementation that I can find. * pango/pango-attributes.c: docs * pango/pango-layout.c: docs
* fixed up g_boxed_type_register_static() since GLib signature changed.Tim Janik2001-03-071-14/+10
| | | | | | | | | Wed Mar 7 09:21:14 2001 Tim Janik <timj@gtk.org> * pango/pango-attributes.c: fixed up g_boxed_type_register_static() since GLib signature changed. * got rid of bogus g_type_init() calls.
* Added pango_attr_list_get_type, and PANGO_TYPE_ATTR_LIST.Alexander Larsson2001-02-281-0/+17
| | | | | | | 2001-02-28 Alexander Larsson <alla@lysator.liu.se> * pango/pango-attributes.[c]: Added pango_attr_list_get_type, and PANGO_TYPE_ATTR_LIST.
* properly update the tail of the list (pango_attr_list_change): flip orderHavoc Pennington2001-02-131-1/+6
| | | | | | | | | | | | | | | | | | 2001-02-12 Havoc Pennington <hp@redhat.com> * pango/pango-attributes.c (pango_attr_list_insert_internal): properly update the tail of the list (pango_attr_list_change): flip order of tmp_list2 = tmp_list2->next and prev2 = tmp_list2 to avoid setting prev2 and tmp_list2 to the same value thus creating a mangled list. * pango/pango-layout.c (pango_layout_xy_to_index): When returning FALSE, set the index/trailing to the nearest location, instead of setting them to 0. (pango_layout_line_x_to_index): Fix a bug where line->start_index wasn't used. Return boolean for whether we had to clamp the value to get an index.
* pass 0 as first argument to g_type_init().Tim Janik2001-02-041-1/+1
| | | | | | | | | | | | | | | | Sun Feb 4 07:48:47 2001 Tim Janik <timj@gtk.org> * pango/pango-attributes.c (pango_color_get_type): pass 0 as first argument to g_type_init(). * pango/pangoxft-fontmap.c (pango_xft_get_font_map): * pango/pangowin32-fontmap.c (pango_win32_font_map_for_display): * pango/pangoft2-fontmap.c (pango_ft2_font_map_for_display): * pango/pangox-fontmap.c (pango_x_font_map_for_display): * pango/pango-context.c (pango_context_new): likewise. * i dare saying that i doubt the usefullness of all these g_type_init() calls though.
* take a PangoColor not a PangoAttrColorHavoc Pennington2001-01-261-8/+49
| | | | | | | | | | | | | | | | | 2001-01-26 Havoc Pennington <hp@redhat.com> * pango/pangox.h (PangoGetGCFunc): take a PangoColor not a PangoAttrColor * pango/pango-attributes.h: add PangoColor, add PANGO_ATTR_INVALID as a placeholder for zero in the PangoAttrType enum, corresponds to G_TYPE_INVALID. * pango/pango-attributes.c: Add PangoColor type, use for PangoAttrColor (pango_color_get_type): new function (pango_color_copy): new function (pango_color_free): new function
* Renamed pango_attribute_compare to pango_attribute_equal. Renamed compareSebastian Wilhelmi2000-11-131-34/+34
| | | | | | | | | | | | | | | | 2000-11-13 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * pango/pango-attributes.c, pango/pango-attributes.h: Renamed pango_attribute_compare to pango_attribute_equal. Renamed compare member of PangoAttrClass to equal. Renamed some static functions from ..._compare to ..._equal. * pango/fonts.c, pango/pango-font.h, pango/pango-context.c: Renamed pango_font_description_compare to pango_font_description_equal. * docs/pango-sections.txt, docs/tmpl/fonts.sgml, docs/tmpl/text-attributes.sgml: Changed accordingly.
* Add a new attribute for scaling a font; also required addingHavoc Pennington2000-11-011-11/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-11-01 Havoc Pennington <hp@pobox.com> * pango/pango-attributes.c (pango_attr_scale_new): Add a new attribute for scaling a font; also required adding PangoAttrFloat. (pango_attr_iterator_get_font): Add PANGO_ATTR_SCALE handling. * pango/pango-utils.c (pango_parse_stretch): Take a plain string not a GString (pango_parse_weight): ditto (pango_parse_variant): ditto (pango_parse_style): ditto * pango/pangox-fontmap.c (pango_x_font_map_read_alias_file): pass GString::str instead of the GString itself to pango_parse_* * pango/pangoft2-fontmap.c (pango_ft2_insert_face): ditto * pango/pangowin32-fontmap.c (pango_win32_font_map_read_alias_file): ditto * pango/pango-layout.c (get_tab_pos): adapt to new pango_itemize() signature (pango_layout_check_lines): Raise attr list copy/creation out of the loop over paragraphs. Adapt to pango_itemize() changes. * pango/pango-context.c (pango_itemize): pass in a starting index and a cached iterator (add_engines): Easy optimization, pass in n_chars instead of recomputing it. Also, pass on the start index and cached iterator. * docs/pango-sections.txt: Add new stuff docs/pango_markup.sgml: Docs on markup format * pango/pango-layout.c (pango_layout_get_attributes): New function to retrieve the AttrList from a layout (pango_layout_set_markup): Set layout from markup (pango_layout_set_markup_with_accel): Set layout from markup including accelerator parsing. * pango/pango-attributes.h (pango_parse_markup): New function to convert a tag string to an attribute list * pango/pango-markup.c (pango_parse_markup): implement * docs/Makefile.am, docs/pango-docs.sgml, docs/pango-sections.txt, docs/pango_markup.sgml: oooooh, documentation for the above patch! * docs/tmpl/pango-unused.sgml: Remove from CVS; just causes problems, and was full of checked-in conflict markers.
* Fix bug where wrong attribute list was unreferenced.Owen Taylor2000-09-111-1/+64
| | | | | | | | | | | | | | Sun Sep 10 03:01:53 2000 Owen Taylor <otaylor@redhat.com> * pango/pango-layout.c (pango_layout_set_attributes): Fix bug where wrong attribute list was unreferenced. * pango/pango-attributes.[ch]: Add function pango_attr_list_splice() to splice contents of one attribute list into another attribute list. * pango/pango-utils.h: Add include of pango-font.h since it now depends on declarations from there.
* Minor fixes to Owen's patch below to make it work.Jonathan Blandford2000-09-081-28/+127
| | | | | | | | | | | 2000-09-08 Jonathan Blandford <jrb@redhat.com> * pango/pango-attributes.c (pango_attr_list_change): Minor fixes to Owen's patch below to make it work. * pango/pango-attributes.c (pango_attribute_copy): Copy the start_index/end_index explicitly rather then rely on the copy function doing it for you, as none did so.
* If the first pango_skip_space fails, remember to free enginepair beforeElliot Lee2000-08-081-1/+3
| | | | | | | | * pango/modules.c: If the first pango_skip_space fails, remember to free enginepair before continuing. * pango/pango-layout.c (pango_layout_set_attributes): unref old attr list after reffing new one, in case setting to same thing. * pango/pango-attributes.c (pango_attr_list_insert_internal): Proper fix from Owen for the infinite loop.
* Fix segfault when tmp_list has no 'prev' pointer. Infinite loops do notElliot Lee2000-08-041-1/+1
| | | | | | | | | | 2000-08-03 Elliot Lee <sopwith@redhat.com> * pango/modules.c: Fix segfault when tmp_list has no 'prev' pointer. * pango/pango-attributes.c (pango_attr_list_insert_internal): Infinite loops do not fast programs make. * pango/pango-context.c: Set a default font size so that things don't go boom if someone forgets to set it themselves. * pango/pango-layout.c (pango_layout_index_to_pos): Exclude newlines from consideration. (pango_layout_line_index_to_x): Take shape attributes into consideration when determining position.
* A bit of code cleanup.Owen Taylor2000-07-211-0/+67
| | | | | | | | | | | | | | | | Fri Jul 21 15:17:26 2000 Owen Taylor <otaylor@redhat.com> * pango/pango-context.c (pango_itemize): A bit of code cleanup. * pango/pango-attributes.[ch]: Add a new attribute type PangoAttrShape, for imposing specific shapes on glyphs. This is used for handling embedded pixmaps and similar objects. * pango/pango-layout.c: Hnadle PangoAttrShape. * pango/pango-context.[ch]:
* Free buffer strings.Owen Taylor2000-07-211-0/+2
| | | | | | | | | | | | | | | | | | | | | Fri Jul 21 09:59:10 2000 Owen Taylor <otaylor@redhat.com> * pango/modules.c (process_module_file): Free buffer strings. * pango/pangox-fontmap.c (pango_x_real_get_coverage_win): Add caching of coverage maps on a persistant subwindow of the root window. This window contains a property for each "lang|xlfd,xlfd" which is the result of pango_coverage_to_bytes. * pango/pango-context.c (pango_context_finalize): Free the font description. * pango/pango-coverage.c (pango_coverage_to/from_bytes): Added functions to covert a PangoCoverage structure too and from a flat block of bytes. * configure.in (X_LIBS): Add a check to detect fribidi being compiled against glib-1.2.x.
* New function that inserts before other attributes with matching startOwen Taylor2000-07-021-17/+48
| | | | | | | | | | | | Sun Jul 2 17:59:56 2000 Owen Taylor <otaylor@redhat.com> * pango/pango-attributes.[ch] (pango_attr_list_insert_before): New function that inserts before other attributes with matching start index. * pango/pango-layout.[ch] (pango_layout_set_font_description): Add the ability to set a default font description on the layout, overriding the font description from the context.
* GTK+ should compile now... sorry about the mess...Havoc Pennington2000-06-211-0/+36
| | | | | | | | | | | | | | 2000-06-14 Havoc Pennington <hp@redhat.com> * pango/pango-attributes.c (pango_attr_list_copy): Function to copy the attribute list. 2000-06-13 Havoc Pennington <hp@redhat.com> * pango/pango-layout.h: Convert PangoLayout to GObject * pango/pango-context.h: Convert to PangoContext to GObject
* New function to copy a PangoAttrIterator.Havoc Pennington2000-06-071-4/+28
| | | | | | | 2000-06-07 Havoc Pennington <hp@redhat.com> * pango/pango-attributes.c (pango_attr_iterator_copy): New function to copy a PangoAttrIterator.
* Add a function pango_layout_line_get_x_ranges(), to allow handlingOwen Taylor2000-04-181-4/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mon Apr 17 12:04:20 2000 Owen Taylor <otaylor@redhat.com> * pango/pango-layout.[ch]: Add a function pango_layout_line_get_x_ranges(), to allow handling selections not as attributes. Which is necessary, since currently setting the background/foreground results in splitting shaped runs. Fri Apr 14 13:20:05 2000 Owen Taylor <otaylor@redhat.com> * pango/pango-layout.c (pango_layout_check_lines): Fix bug with indent handling. * pango/pango-layout.c (process_item): Never break a line at a non-break position, even if that position ends an item. Fri Apr 14 10:43:09 2000 Owen Taylor <otaylor@redhat.com> * pango/pangox.c (pango_x_render_layout_line): Fix a missing PANGO_SCALE factor for UNDERLINE_SINGLE. * pango/pango-layout.c (pango_layout_get_cursor_pos): New function to determine cursor positions corresponding to a particular index. Wed Apr 12 15:44:22 2000 Owen Taylor <otaylor@redhat.com> * pango/pango-attributes.[ch]: Add PANGO_ATTR_FONT_DESC, which allows an entire font description to be specified as a single attribute, instead of as 6 separate attributes.
* Doc updates.Owen Taylor2000-04-051-1/+1
| | | | | | | Tue Apr 4 20:56:29 2000 Owen Taylor <otaylor@redhat.com> * docs/tmpl/* docs/Makefile.am docs/pango-sections.txt pango/pango-attributes.c pango/pangox.c: Doc updates.
* Fix off-by-one error for RTL runs.Owen Taylor2000-04-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | | Mon Apr 3 15:16:06 2000 Owen Taylor <otaylor@redhat.com> * pango/glyphstring.c (pango_glyph_string_get_logical_widths): Fix off-by-one error for RTL runs. * configure.in: Add -lglib to AC_CHECK_LIB(fribidi...) (How did this work?) From Matt Wilson. * pango/pango-layout.c (pango_layout_check_lines): Correctly deal with handling character offsets when breaking lines. * modules/arabic/arabic.c (arabic_engine_shape): Fix problem with setting unknown glyph when no arabic-capable font found. Fri Mar 31 11:29:47 2000 Owen Taylor <otaylor@redhat.com> * pango/pangox.[ch] (pango_x_render_layout[_line]) examples/viewer.c: Add capability to render foreground / background colors. The interfaces here are possibly certainly not right, or convenient, but they should be a start.
* Memory management functions for PangoItem.Owen Taylor2000-03-131-21/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mon Mar 13 10:54:48 2000 Owen Taylor <otaylor@redhat.com> * pango/pango-item.[ch]: Memory management functions for PangoItem. * pango/*.[ch]: Random constification. * pango/pangox.c pango/pango-layout.c pango/pango-context.c: Add an extra_attrs field to PangoItem. Use this to handle underlining for PangoLayout. * examples/viewer.c (reload_font): Make paragraphs global to save the complexity of passing it around all over the place. * pango/pango-layout.[ch] (pango_layout_context_changed): Add a function to reset the layout on changes to the layout's context. * pango/pangox.c (pango_x_make_matching_xlfd): Prefer bitmap to scaleable if the discrepancy is < 1 pixel. (Probably not the ideal criterion.) * pango/pangox.c (pango_x_font_map_for_display): Fix resolution computation error. * pango/pango-layout.c (pango_layout_check_lines): Handle text with embedded newlines. * pango/pangox.c (pango_x_render_layout): Fix y to refer to the top of the layout, not the baseline of the first line. * pango/pango-layout.c (process_item): Don't wrap if width is set to -1. * Makefile.am configure.in **/*.[ch]: move libpango/ directory and fix all headers to install under include/pango/
* Convert log_clusters[] use from char offsets to byte offset - should makeOwen Taylor2000-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Mon Mar 6 20:55:32 2000 Owen Taylor <otaylor@redhat.com> * libpango/mapping.c example/viewer.c: * modules/hangul/hangul.c modules/basic/basic.c modules/tamil/tamil.c: Convert log_clusters[] use from char offsets to byte offset - should make it easier to have all interface deal with stuff in byte offsets. * libpango/mapping.c libpango/pango-glyph.h: Rename x_to_cp and cp_to_x to make them "member functions" of glyph_string. * libpango/pango-types.h: Add a rectangle type for use in storing glyph/glyph-string extents, plus macros for extracting ascent/descent. * libpango/fonts.c libpango/pango-font.h libpango/pangox.c: Virtualize glyph extents function into the font. * libpango/pangox.c modules/*/*.c examples/viewer.c: Convert over to new rationalized unit system - everything in 1000ths of a point or 1000ths of a glyph unit. * libpango/pango-glyph.h libpango/glyphstring.c: Add function to get extents of a glyph string. (We may want to fastpath the width in the future, since getting the width seems to be a very common and time-critical operation)
* Add size to the font description structure instead of continually passingOwen Taylor2000-02-251-0/+3
| | | | | | | | | | | | Fri Feb 25 15:04:21 2000 Owen Taylor <otaylor@redhat.com> * libpango/{fonts.c,pango-font.h,pango-context.[ch],pangox.c, pango-attributes.c,examples/viewer.c: Add size to the font description structure instead of continually passing it around as an extra argument. * libpango/pangox.c: Take screen resolution into account when choosing fonts, instead of assumming point == pixel.
* Make refcounted.Owen Taylor2000-02-161-47/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wed Feb 16 16:39:46 2000 Owen Taylor <otaylor@redhat.com> * libpango/pango-coverage.c (pango_coverage_get): Make refcounted. * libpango/modules.c (struct _PangoEnginePair): Since we don't currently unload engines, cache loaded engines. (Not really quite satisfactory, but should work OK) * libpango/pango-context.c (pango_context_get_font_description): Added a global font description. * libpango/modules.c (_pango_find_map): Allow NULL language tags. * libpango/pango-context.c (pango_itemize) examples/viewer.c: Switch itemize over to take a PangoAttrList. * examples/viewer.c: Conform to changes in itemization interface * libpango/font.[ch]: Add a compare function for FontDescription * libpango/pango-attributes.[ch]: Change the iteration iterface to be more convenient. * libpango/pango-context.[ch]: Add the ability to set a default font. * libpango/pango-context.[ch]: Take the font for itemization from the attributes on the text. * libpango/pangox.c: Cache currently loaded fonts, and cache coverages.
* Add documentation for attributes.Owen Taylor2000-02-151-55/+571
| | | | | | | | | Tue Feb 15 02:35:56 2000 Owen Taylor <otaylor@redhat.com> * docs/**: Add documentation for attributes. * Makefile.am libpango/pango-attributes.[ch]: Finish initial implementation of attributes APIs.
* Start of attribute lists.Owen Taylor2000-02-151-0/+386
Mon Feb 14 22:04:38 2000 Owen Taylor <otaylor@redhat.com> * libpango/pango-attributes.[ch]: Start of attribute lists.