summaryrefslogtreecommitdiff
path: root/src/ui/text.c
AgeCommit message (Collapse)Author
2021-07-15Fixing regressions text metrics, InputWidgetJaakko Keränen
`run_Font_` was moving the Y cursor position twice for each line break. Checking for the HarfBuzz UNSAFE_TO_BREAK flag leads to some unexpected behavior near edges of words. The old `tryAdvanceNoWrap` method should return the maximum horizontal advance of the text, and not the cursor position's advance. `draw_WrapText` used the wrong foreground color. `TextBuf` now uses WrapText to do all the measuring and drawing, making things much simpler.
2021-07-15GmDocument: Right-align RTL decorationsJaakko Keränen
2021-07-14Text: Detect Arabic scriptJaakko Keränen
It appears HarfBuzz's script autodetection isn't working here for Arabic.
2021-07-14Fixed text wrapping when HarfBuzz is disabledJaakko Keränen
Updated the old simple text renderer for the new WrapText wrapping.
2021-07-14Text: Ordering runs vs. paragraph/run directionJaakko Keränen
2021-07-14CleanupJaakko Keränen
2021-07-13Drawing document RTL text runsJaakko Keränen
The base text direction of each line of text is determined when the document is laid out. When drawing runs, use this predetermined base direction.
2021-07-13Text: Bidi text wrappingJaakko Keränen
There is still some weirdness with wraps that occur inside a bidi region. The problem is that text drawing is done later, in smaller segments, without knowledge of the paragraph base direction. The base direction should be saved into each GmRun as a flag.
2021-07-13Text: Working on bidi text wrappingJaakko Keränen
2021-07-06Text run measurement API change; bug fixesJaakko Keränen
The distinction between measure_Text and advance_Text was not very clear. Now there are only measure_Text functions that return both the bounds and the cursor position advancement, and the appropriate metrics are used by the caller.
2021-07-04CleanupJaakko Keränen
2021-07-04Text: Apply FriBidi (again); fixed wrapping bugsJaakko Keränen
2021-07-04Text: Refactoring AttributedTextJaakko Keränen
AttributedText converts the text to a visual UTF-32 string. This allows it to be processed in a more straightforward fashion, and the indirection allows reordering via FriBidi.
2021-07-04Text: Adjusted Noto Symbols scalingJaakko Keränen
2021-07-04Text: Right-align RTL text linesJaakko Keränen
2021-07-03Added build options for HarfBuzz and FriBidiJaakko Keränen
Allow using both `pkg-config` provided libraries for local builds, and configuring more minimal versions for distribution. HarfBuzz has a bunch of dependencies by default. TODO: ENABLE_FRIBIDI_BUILD should cause a static library to be built.
2021-07-03Text: Use FriBidi for visual orderJaakko Keränen
Todo: This seems a little late in the game. The reordering should be done for each paragraph of text.
2021-07-03Text: CleanupJaakko Keränen
2021-07-02Text: Monospace glyph fitting; trying out soft hyphensJaakko Keränen
If glyphs are borrowed from a different font, the offset/advance are adjusted to fit the correct monospacing (for pictographs/emoji).
2021-07-02Text: Keep Nunito Italic kerning as-isJaakko Keränen
2021-07-02Text: Skip space at word wrap positionJaakko Keränen
2021-07-02CleanupJaakko Keränen
2021-07-02Text: Nunito kerning adjustmentJaakko Keränen
2021-07-02Text: Word wrapping; fixed glyph cachingJaakko Keränen
2021-07-01Text: Working on line wrappingJaakko Keränen
2021-07-01Text: Working on HarfBuzzJaakko Keränen
2021-06-30CleanupJaakko Keränen
2021-06-30Text: Internal and ANSI color escapesJaakko Keränen
2021-06-30Text: Use HarfBuzz to shape textJaakko Keränen
This kind of already works! HarfBuzz will composite glyphs as expected. Still missing: half-pixel offsets, line wrapping, color escapes, monospace grid alignment. FriBidi will still be required to determine/reorder text direction within each run.
2021-06-26Text: Link with HarfBuzz; old run_Font_ is a fallbackJaakko Keränen
HarfBuzz will provide proper Unicode text shaping for both simple and complex scripts. The old `run_Font_` is available for use as a fallback if HarfBuzz is not available due to size or complexity constraints (it's written in C++).
2021-06-25Merge branch 'dev' into work/v1.6Jaakko Keränen
# Conflicts: # CMakeLists.txt
2021-06-24Text: Tune kerning on NunitoJaakko Keränen
2021-06-15Text: Small font is semibold for legibilityJaakko Keränen
2021-06-15TextBuf: Attempted workaroundJaakko Keränen
It is possible that calling `SDL_RenderClear` was not performing the expected clearing of the TextBuf texture due to the wrong blend mode being in effect. IssueID #271
2021-06-15Mobile: Show identity name in toolbarJaakko Keränen
Shuffled the widget flags a bit to make room for a new one.
2021-06-15Mobile: Draw Identity button as outlineJaakko Keränen
2021-06-14TextBuf: Attempted workaroundJaakko Keränen
It is possible that calling `SDL_RenderClear` was not performing the expected clearing of the TextBuf texture due to the wrong blend mode being in effect. IssueID #271
2021-06-14Swiping and sidebar; various tweaksJaakko Keränen
When a page is opened from the sidebar, swiping back will now reopen the sidebar. Another swipe will dismiss the sidebar and navigate back as usual. Attempted to cache theme colors in GmDocument, but there were issues with theme changes.
2021-06-09Merge branch 'dev' into work/typesetterJaakko Keränen
# Conflicts: # src/gmdocument.c # src/ui/documentwidget.c # src/ui/inputwidget.h
2021-05-29Text: Use arrows from IosevkaJaakko Keränen
2021-05-29Text: Use Iosevka as final fallback fontJaakko Keränen
2021-05-28DocumentWidget: Improved drawing of link key shortcutsJaakko Keränen
2021-05-27DocumentWidget: Composited link numbers/lettersJaakko Keränen
Draw the circle and the number/letter separately since we don't have a font with all the glyphs.
2021-05-27Fixed icon alignmentsJaakko Keränen
Some of the icons in the Bookmarks list and lookup results were misaligned.
2021-05-26Fonts: Added more Smol Emoji symbolsJaakko Keränen
2021-05-25Removed Symbola, replaced with other/new fontsJaakko Keränen
Symbola's license is not permissive enough, so it has been removed. Added "Smol Emoji" with face emoticons and other UI characters for Lagrange. More symbols provided by Noto Sans Symbols and Noto Sans Symbols 2. The fallback fonts are now Iosevka, which has a pretty good coverage (although monospace), and the user's chosen TrueType font (which could still be a local copy of Symbola). Still a work in progress: some characters are missing. IssueID #283
2021-05-18Merge branch 'dev' into work/typesetterJaakko Keränen
# Conflicts: # src/ui/documentwidget.c # src/ui/inputwidget.c
2021-05-14Text: Fixed handling of newlinesJaakko Keränen
In the `tryAdvance*` methods, don't advance past newlines since this is intended to be a line-based operation.
2021-05-14InputWidget: Fixed cursor moving; scroll the dialogJaakko Keränen
Up/down movement sometimes ended up in the wrong cursor position. Now the nearest overflow-scrollable parent scrolls to keep the cursor visible.
2021-05-13InputWidget: Drawing hint and buffered textJaakko Keränen
Improved TextBuf to handle word/bound-wrapped content.