summaryrefslogtreecommitdiff
path: root/pango/itemize.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix char offset calculationsfix-char-offsetMatthias Clasen2022-11-181-4/+8
| | | | | | | | | | | | When dealing with multi-paragraph layouts, the char offsets of the items are expected to be relative to the beginning of the text, not relative to the beginning of the current paragraph. This error was introduced in a03bf5bc6b07ba6e. Fixes: #716
* itemize: Use pango_font_get_variantstrdup-avoidanceMatthias Clasen2022-08-271-9/+2
| | | | | This avoids the unnecessary copy of the fonts font description, just to extract the variant.
* itemize: Be more defensivenull-fontsMatthias Clasen2022-04-121-4/+10
| | | | | Let them have their NULL fonts. Produce hexboxes without criticals.
* Check for fontmapsno-fontmap-no-funMatthias Clasen2022-01-141-0/+2
| | | | | | | To avoid trivialities, check that our context has a fontmap, at a strategic place. Fixes: #658
* itemize: Try harder to avoid NULL fontsMatthias Clasen2021-12-251-3/+5
| | | | | Always fall back to the base font if the fontset has no coverage.
* Drop pango-fontset-private.hMatthias Clasen2021-12-241-1/+1
| | | | This was just an empty header.
* Fix line height with emulated small capsfix-small-caps-line-heightMatthias Clasen2021-12-191-4/+13
| | | | | | | | When we change font scale for emulating small caps, keep the original font around in the analysis, and use it for calculating the run height. Fixes: #622
* Fix Arabic format charsMatthias Clasen2021-12-161-18/+22
| | | | | | | We can't treat these like spaces, since they are visible and need the proper font. Fixes: #642
* docs: Cosmeticsmisc-doc-fixupsMatthias Clasen2021-12-101-5/+5
| | | | | Add more links to GLib apis and to various Unicode specs.
* Fix a bug in Small Caps handlingMatthias Clasen2021-11-131-2/+2
| | | | | | | | | We were not passing the correct split_offset to pango_item_split(). Testcase included. Fixes: #627
* itemize: Handle text transformssmall-capsMatthias Clasen2021-11-081-17/+70
| | | | | | Take text transforms into account when emulating Small Caps. This requires us to have log attrs to determine word starts.
* Reshuffle itemize APIMatthias Clasen2021-11-081-24/+40
| | | | | | | | | | | Split the post-processing off into a separate function that can take log attrs in addition. This will allow us to handle word starts when dealing with text transforms for emulated Small Caps. So far, this is all private API that is used from PangoLayout. Please file an issue if you want to access Small Caps emulation without PangoLayout.
* Cosmetics: Add the right sectionMatthias Clasen2021-11-071-1/+4
| | | | Move private API out of the 'Public API' section.
* itemize: Emulate other casing variantsMatthias Clasen2021-11-071-67/+130
| | | | | | | | | | | | When we detect that one of the other casing variants is requested, but not available via OpenType font features, emulate it by splitting the item into lowercase and uppercase runs and apply a suitable font scale and text transform to the runs to get the desired effect. Still to do: resolve conflics with preexisting text transform attributes.
* itemize: Implement emulated Small CapsMatthias Clasen2021-11-071-1/+181
| | | | | | | | | | | When we detect that Small Caps are requested, but not available via OpenType font features, emulate Small Caps by splitting the item into lowercase and uppercase runs and add text transform and font scale attributes to the lowercase runs to get the effect of Small Caps. Still to do: resolve conflicts with preexisting text transform attributes.
* itemize: Break out a helperMatthias Clasen2021-11-071-27/+32
| | | | | | Factor out the 'consider as space' part from the itemization code, so we can reuse it when breaking items into upper- and lowercase runs.
* itemize: Handle PANGO_FONT_SCALE_SMALL_CAPSMatthias Clasen2021-11-071-17/+39
| | | | This is not used by anything yet.
* Avoid a crashMatthias Clasen2021-09-011-5/+12
| | | | I was carelessly not initializing prev to NULL.
* Implement font-dependent scalingMatthias Clasen2021-08-311-15/+166
| | | | | | | Add a new font-scale attribute to indicate font size changes due to super- and subscript shifts, and handle it during item post-processing to find the right font sizes.
* item: Add a char offsetMatthias Clasen2021-08-281-1/+15
| | | | | | | | | | | | | Add a char_offset field to PangoItem, compute it as part of itemization and update it when splitting items. Keeping this number around cuts down on the amount of list and utf8 walking we need to do later. We have to do some extra shenanigans to preserve abi in the face of pango's open-coded structs, so we introduce a PangoItemPrivate type that is used internally. On 64bit, PangoItem has a 4 byte whole, so we can keep the size of PangoItemPrivate the same. No such luck on 32bit.
* CosmeticMatthias Clasen2021-08-281-22/+16
| | | | | | Improve the itemization code to have all variants take the same code paths, so we can do fixups in one place.
* Some code reorgMatthias Clasen2021-08-201-0/+1151
| | | | | Split the itemization code into its own file, and move things around a bit.
* Add a new PangoLanguage type to represent language tags; these canOwen Taylor2001-06-141-232/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* move pango_shape and pango_reorder_items in here.Havoc Pennington2000-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-12-15 Havoc Pennington <hp@pobox.com> * pango/pango-glyph.h: move pango_shape and pango_reorder_items in here. * pango/pango-break.h: move most of pango.h in here, so that pango.h can be the only file that includes pango-enum-types.h, so that changing any header doesn't end up rebuilding all of pango due to a rebuild of pango-enum-types.h. * pango/makeenums.pl: script to generate pango-enum-types.[hc] * pango/Makefile.am (pango_headers): built pango-enum-types.h, pango-enum-types.c that do enum type registration; add pango-break.h; do some assorted rearranging to handle the built headers * pango/pango.h: moved most of it to pango-break.h * pango/break.c: include individual headers, not pango.h * pango/shape.c: ditto * pango/reorder-items.c: ditto * pango/querymodules.c: ditto * pango/pango-layout.c: ditto * pango/pango-indic.c: ditto * pango/mapping.c: ditto * pango/itemize.c: ditto * pango/fonts.c: ditto
* Remove checks for iconv - we now depend on g_iconv wrapper defined inOwen Taylor2000-11-121-1/+0
| | | | | | | | | | | | | Sun Nov 12 18:36:38 2000 Owen Taylor <otaylor@redhat.com> * configure.in (included_modules): Remove checks for iconv - we now depend on g_iconv wrapper defined in GLib. * modules/basic/basic.c: Use g_iconv_* not iconv(). * pango/itemize.c pango/pango-context.c modules/thai/thai.c: Remove spurious iconv.h includes.
* Include a stripped-down version of fribidi to avoid the extra dependency.Owen Taylor2000-11-121-2/+1
| | | | | | | | | | | | | | | | | | | | Sun Nov 12 16:07:06 2000 Owen Taylor <otaylor@redhat.com> * configure.in pango/pango-utils.[ch] pango/Makefile.am pango/mini-fribidi/*: Include a stripped-down version of fribidi to avoid the extra dependency. No fribidi symbols are exported so conflicts with the real fribidi should not happen. Library can optionally be compiled with the real libfribidi. * pango/pango-utils.[ch]: Wrappers for fribidi_ functions when compiling with fribiid. * modules/basic/basic-ft2.c modules/basic/basic-win32.c modules/basic/basic.c modules/thai/thai.c pango/Makefile.am pango/itemize.c pango/pango-context.c pango/pangoft2.c pango/pangowin32.c pango/pangox.c: Use pango_ versions of fribidi functions.
* Remove tests for libunicodeOwen Taylor2000-06-211-6/+5
| | | | | | | | | | | | Wed Jun 21 12:11:56 2000 Owen Taylor <otaylor@redhat.com> * configure.in: Remove tests for libunicode * pango/utils.[ch]: Removed. The functions from here are now in GLib. * **.[ch]: Removed use of libunicode and utils.c in favor of Unicode functions in GLib. Requires latest GLib from CVS.
* *** empty log message ***Owen Taylor2000-06-081-2/+2
|
* Add ZWS to hacky break algorithm.Owen Taylor2000-05-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fri May 5 18:56:45 2000 Owen Taylor <otaylor@redhat.com> * pango/break.c (pango_break): Add ZWS to hacky break algorithm. * modules/basic/basic.c (basic_engine_shape): Special case zero-width-space as a temporary hack. (What's the right solution?) * modules/basic/tables-big.i: Added support for TIS-620 encoding. * configure.in pango/modules.[ch] pango/Makefile.am modules/**: First stab at support for linking modules directly into Pango. Add a --with-included-modules= flag that causes the specified modules to be built as convenience libraries and linked directly into libpangox. Tue May 2 22:59:52 2000 Owen Taylor <otaylor@redhat.com> * modules/basic/basic.c: Get rid of link list of masks in cache structure in favor of an array. (This is easy to do now since we already have linear indices for the masks from the new table format.) * pango/modules.c pango/pango-context.c pango/pangox.c: Modify _pango_find_map() to take quarks for the engine type and render type instead of strings. Get rid of the map hash table in favor of a GList with the most recently used map at the beginning. * pango/modules.[ch] pango/pango-context.c pango/pangox.c: Add some utility functions for getting the engine for a particular character in a map. Using modules.c knowledge of map structure, this allows us to save a bunch of useless strcmps. * pango/pango-context.c (add_engines): Remove unused lookup of shape mask. * modules/basic/tables-{small,big}.i modules/basic/basic.c tools/compress-table.pl: Reencode mask table to avoid binary searches and save a bit of space. * modules/basic/basic.c (find_converter): Get rid of gratuitous use of hash tables for looking up iconv converters. * modules/basic/tables-{small,big}.i modules/basic/basic.c: Use conv_ucs4 instead of conv_8bit for latin-1. * pango/pango-layout.c: Avoid calling pango_glyph_string_extents() - just add up the widths from shaping.
* Memory management functions for PangoItem.Owen Taylor2000-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/
* First draft of highlevel driver. It currently only handles a paragraph asOwen Taylor2000-03-081-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wed Mar 8 13:34:57 2000 Owen Taylor <otaylor@redhat.com> * libpango/pango-layout.[ch]: First draft of highlevel driver. It currently only handles a paragraph as a list of lines, but it is probably necessary to make it handle 2D layout for a paragraph as well * examples/viewer.c: Move over to new layout driver (much of the code moved into pango-layout.c) * libpango/glyphs.c libpango/pango-glyphs.h: Fixes to get_extents(), add pango_glyph_string_get_logical_widths. * libpango/pango-itemize.c: Handle 0-length text properly. * libpango/pangox.c: When loading particular sized fonts, use the original XLFD, since XFree86 doesn't handle wildcards in aliases properly. * libpango/pangox.[ch] (pango_x_render_layout_line): Add function to render an entire PangoLayoutLine. * libpango/reorder-items.c: Add a note to the effect that pango_reorder_items() is basically replaced by a similar function in PangoLayout. Wed Mar 8 10:58:56 2000 Owen Taylor <otaylor@redhat.com> * modules/arabic/arconv.c (shapecount): Fix from Karl Koehler to joining behavior. * modules/Makefile.am modules/arabic/*: Added arabic shaper from Karl Koehler <koehler@or.uni-bonn.de> * modules/basic/tables-{small,big}.i: Remove arabic from the ranges that the basic shaper marks as "exact". * examples/HELLO.utf8: Partially alphabetize, add arabic.
* Initial revisionOwen Taylor2000-01-131-0/+234