summaryrefslogtreecommitdiff
path: root/pango
Commit message (Collapse)AuthorAgeFilesLines
* doc: fixesMatthias Clasen2021-12-024-5/+5
|
* jsonparser: Plug a memory leakserializer-rewriteMatthias Clasen2021-12-021-0/+2
|
* Add pango_font_deserializeMatthias Clasen2021-12-022-0/+89
| | | | | This will make the font serialization useful in GTK, where we serialize fonts in node files.
* Small fixesMatthias Clasen2021-12-022-8/+4
| | | | | Properly document deserialization errors, and drop unused enum values.
* assorted serializer fixesMatthias Clasen2021-12-021-29/+23
|
* serializer: Move all error handling to the parserMatthias Clasen2021-12-021-222/+108
| | | | Just let the parser carry the error.
* Add gtk_json_parser_set_errorMatthias Clasen2021-12-022-0/+12
|
* serializer: Replace json-glibMatthias Clasen2021-12-026-855/+2484
| | | | Replace json-glib by a homegrown json parser/printer.
* tabs: Add a missing setterMatthias Clasen2021-12-022-0/+23
| | | | | Add pango_tab_array_set_positions_in_pixels, to help the serializer out.
* Fix up tab sizingtab-speedupMatthias Clasen2021-12-021-23/+18
|
* layout: Small optimizationMatthias Clasen2021-12-021-25/+3
| | | | | Don't calculate line width the hard way when we can do it much easier.
* layout: Optimize tab handlingMatthias Clasen2021-12-011-1/+1
| | | | | | We don't need to iterate the entire tab array every time, we just continue from the previous tab stop position.
* layout: Call pango_tab_array_sortMatthias Clasen2021-12-011-3/+6
| | | | | We want to optimize access to tab stops, and will assume they are ordered.
* layout: Some restructuring of tab handlingMatthias Clasen2021-12-011-54/+43
| | | | Introduce a LastTab struct, and use it.
* Add pango_tab_array_sortMatthias Clasen2021-12-012-0/+28
| | | | | A utility function to ensure tab stops are in increasing order.
* tabs: Tweak string formatMatthias Clasen2021-11-291-1/+1
| | | | Use newlines to separate tabs, rather than spaces.
* tabs: Add a decimal pointMatthias Clasen2021-11-295-23/+137
| | | | | | | This is useful for PANGO_TAB_DECIMAL. Implement this in PangoLayout, in the serializer, and update tests.
* layout: Implement tab alignmentsMatthias Clasen2021-11-291-57/+201
| | | | | | | | | | | | | Implement the other tab alignments by adjusting the tab width as we go. Based on an old patch by Itai Bar-Haim. This also includes a fix for the previously supported left tab alignment in the presence of indent. Fixes: #34
* serializer: Support tab alignmentsMatthias Clasen2021-11-291-3/+31
| | | | | | | | | Serialize tab alignment in addition to tab position. We still accept the old format and default alignment to left. Update testserialize and layout tests for this.
* tabs: Add other tab alignmentsMatthias Clasen2021-11-292-13/+52
| | | | | Add right, center, decimal tab alignments and support them in serialization. They are not implemented yet.
* docs: Add a note on tabsMatthias Clasen2021-11-291-1/+2
| | | | | Explain that tabs really only work with PANGO_ALIGN_LEFT.
* Never show variation selectorsMatthias Clasen2021-11-282-4/+45
| | | | | | | | Even when we show ignorables, we still want to ignore variation selectors and other ignorables that we don't have nicks for. Test included.
* Fix line heights in improper gravitiesgravity-fixesMatthias Clasen2021-11-271-1/+1
| | | | | | | | | | | Without this, we end up with line height being zero in gravity north or west. The visible symptom is that wrapped lines are drawn on top of each other with line-height != 0. Affected tests have been updated. Fixes: #631
* Fix misplaced glyphs in gravity eastMatthias Clasen2021-11-271-1/+4
| | | | | This was showing up as glyphs placed outside their logical extents.
* font: Avoid cosmetic uglinessMatthias Clasen2021-11-271-2/+3
| | | | | | | | When setting variations to "", font descriptions would add an ugly useless " @" at the end of their serialization. Avoid that. Test included.
* Avoid an out-of-bound accessMatthias Clasen2021-11-271-1/+1
| | | | | We can only use the width of the previous char if we are not at the first char. Found by asan.
* Make sure glyphinfo is fully initializedMatthias Clasen2021-11-261-0/+1
| | | | | The alternative is random test failures, now that we check all these fields in test-layout.
* Merge branch 'hinted-metrics-fixes' into 'main'Matthias Clasen2021-11-262-4/+30
|\ | | | | | | | | | | | | Hinted metrics fixes Closes #626 See merge request GNOME/pango!518
| * Calculate hinted font height based on the hinted extentsSebastian Keller2021-11-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The previous code was calculating the rounded up version of the difference between the unhinted ascender and uninted descender. This however would only result in the correct height if both unhinted extentss together only differ by less then an a Pango unit from their hinted counterparts. Otherwise the resulting height would be 1 unit too short. Fix this by using the difference between the hinted extents as height. Fixes: https://gitlab.gnome.org/GNOME/pango/-/issues/626
| * Introduce and use FLOOR and CEIL macros in Pango unitsSebastian Keller2021-11-222-4/+30
| | | | | | | | | | | | | | This replaces the code that was trying to implement those via the ROUND macro. This avoids a potential issue with values that already were on whole units being rounded up to the next whole unit in the code that was implementing CEIL this way.
* | Add a newline to serialization resultsMatthias Clasen2021-11-251-1/+5
| | | | | | | | | | | | | | | | Otherwise editing the output in an editor is likely to make the data not match anymore, since most editors will add a final newline. Update all tests
* | serializer: Include unknown glyphs countMatthias Clasen2021-11-241-0/+3
| |
* | Add pango_font_serializeMatthias Clasen2021-11-242-0/+58
| | | | | | | | | | | | | | Another debug api. This function produces a serialization of a font that is enough to uniquely identify the font. This is more detailed than what pango_font_describe creates.
* | serializer: Support a "comment" fieldMatthias Clasen2021-11-241-0/+47
| | | | | | | | | | | | Json doesn't have comments, so we have to add an explicit comment value. This will be useful to describe what test cases are about.
* | Optionally serialize outputMatthias Clasen2021-11-242-1/+384
| | | | | | | | | | | | | | If requested, serialize lines, runs, and log attrs. This will let us use the serialization format to record not just the test inputs, but outputs as well.
* | Add a way to get the font matrixMatthias Clasen2021-11-243-0/+44
| | | | | | | | | | | | Add some private api for the serializer to get the font matrix. This is needed to let the serializer write a unique fingerprint for the font.
* | More context serialization workMatthias Clasen2021-11-241-3/+61
| |
* | serializer: CosmeticsMatthias Clasen2021-11-241-11/+16
| | | | | | | | Avoid writing out empty attributes or tabs.
* | Allow serializing context informationMatthias Clasen2021-11-242-10/+134
| | | | | | | | | | | | | | | | | | Optionally include context information in the serialization and restore it. This will be useful for transporting for giving tests complete data that affects their output. Some tests included.
* | Add flags to serialize and deserializeMatthias Clasen2021-11-242-14/+52
| | | | | | | | | | | | | | This gives us some room to add more things to these apis, e.g. a way to store not just the input part of a layout, but also the output.
* | Refactor enum serialization error handlingMatthias Clasen2021-11-241-54/+68
| |
* | Rename the serialize errorsMatthias Clasen2021-11-242-31/+49
| | | | | | | | | | They are produced by deserialization, so call them that.
* | CosmeticsMatthias Clasen2021-11-241-3/+3
| |
* | Fix visible space handlingMatthias Clasen2021-11-241-3/+5
| | | | | | | | | | Make space actually show up as visible space when we want that.
* | Fix handling of extra widthline-breaking-fixes4Matthias Clasen2021-11-221-5/+23
| | | | | | | | | | | | | | When handling items that fix completely, we were not consistently taking extra width into account, leading to hyphens sticking out in some cases.
* | break: Fix hyphen conditionMatthias Clasen2021-11-221-2/+7
| | | | | | | | | | | | | | When looking at scripts, we want to look at the script of the *previous* character. And then we need to exclude SHY from the common script.
* | Fix a case of unintended hyphenationMatthias Clasen2021-11-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | When we take a complete item because there are no breakpoints, we were inserting a hyphen at the end even though there may not be a breakpoint there, and ending up with a hyphen in the middle of an (overlong) line: Brat-wurst. Test included. This but was discovered with the help of http://gitlab.gnome.org/matthiasc/layout-editor
* | Add more autoptr definitionsMatthias Clasen2021-11-225-0/+14
|/
* Don't replace | with hyphensMatthias Clasen2021-11-191-2/+1
| | | | | | | | | | | I went a bit overboard in #603. The vertical bar is too common, and this usage to specialized to do it by default. To enable this, we should rather make log attrs tweakable. We still replace hyphenation points with hyphens. Fixes: #630
* Tweak word and sentence attributesMatthias Clasen2021-11-191-2/+2
| | | | | | The value does not really matter for these, but it looks more natural if they have a value of 1, and not 0.