summaryrefslogtreecommitdiff
path: root/src/ui/text.c
AgeCommit message (Collapse)Author
2021-11-29Fixed issues with tab button labelsJaakko Keränen
Fixed issue with very short text not being truncated at all. A short truncated label will now just show the icon, if one is set. The tab close buttons don't appear if the buttons are too small.
2021-11-21Apply ANSI SGR background colorsJaakko Keränen
The background color of the current text run can be changed via ANSI SGR control sequences. Improved the ANSI escape sequence regex to detect more than just SGR sequences, so they can be properly filtered out.
2021-11-14Merge branch 'dev' into work/v1.9Jaakko Keränen
# Conflicts: # CMakeLists.txt # Depends.cmake # src/lang.c
2021-11-12FontPack: Font dropdown includes IDs if ambiguousJaakko Keränen
If some fonts have the same human-readable name, the unique font ID will be added to show which font it actually is.
2021-11-04Merge branch 'dev' into work/v1.9Jaakko Keränen
# Conflicts: # src/lang.c
2021-11-01Fixed build with the simple text rendererJaakko Keränen
IssueID #372
2021-10-31Changed format of resources.lgrJaakko Keränen
Resources are now stored in a ZIP archive, and it comes with an explicit version number. All the old embed/bincat stuff was removed as unnecessary. resources.lgr is also a valid fontpack, for loading the built-in fonts. IssueID #363
2021-10-29FontPack: Loading fonts from TTC filesJaakko Keränen
2021-10-26Text: Use "alternative font 1" escape for monospaceJaakko Keränen
2021-10-25Document presentation warningsJaakko Keränen
Warn the user about missing glyphs and potentially unsupported ANSI escapes. TODO: Site-specific setting for dismissed warning; fonts preference about missing glyph warnings.
2021-10-20Installing individual TTF files; generate fontpack.iniJaakko Keränen
2021-10-18Preferences: ANSI escape flagsJaakko Keränen
FG color and font style escapes can be enabled separately. FG color remains enabled by default like before.
2021-10-18Text: Fixed a memory leakJaakko Keränen
When GlyphBuffers were freed, the array holding them wasn't.
2021-10-15Text: Fixed a line wrapping issueJaakko Keränen
When the last safe break position was not in the current attributed run, the calculated wrap advance came out incorrect. This was possible when the first glyph in an attributed run didn't fit.
2021-10-14Preferences: ANSI escape sequences in GemtextJaakko Keränen
It can be argued that using ANSI escapes to style text goes against the intended use of Gemtext. Therefore, all ANSI escapes are now disabled by default in Gemtext.
2021-10-13Text attributes that change inside a runJaakko Keränen
These changes concern the situation when the attributes of text (i.e., font, color) are changed via escape sequences. The concept of "base attributes" was added so that the low-level text renderer knows which font/color to set when a "reset" escape sequence is encountered. This depends on what kind of text is being renderer, e.g., preformatted or regular paragraphs. The base attributes were added as variables in Text because it was getting unwieldy to pass all the information via the draw/measure/WrapText functions. GmDocument now has a GmTheme struct that collects the font and color information into a single place.
2021-10-13Added preference for font smoothingJaakko Keränen
2021-10-12Experimental Markdown renderingJaakko Keränen
Convert Markdown to Gemtext and use ANSI escape sequences to switch fonts (bold, italic, monospace). The conversion is still a bit buggy...
2021-10-09Preferences: Selecting fonts to useJaakko Keränen
Now all the available fonts are selectable in the dialog. Added preformatted and UI font settings and shuffled the order a bit to make more sense.
2021-10-08Font configuration; Prefs has a string value arrayJaakko Keränen
Added a second version of Iosevka with more line spacing, to be used as the default monospace document font.
2021-10-07DocumentWidget: Line width based on font glyph widthJaakko Keränen
The idea is that the amount of content should be the same per line regardless of the font.
2021-10-06Text: Fixed font lookup orderJaakko Keränen
Check auxiliary fonts first, and then all primary fonts that haven't been checked yet.
2021-10-06Fixed a couple of font issuesJaakko Keränen
Scaling of monospace and symbols; cache reset.
2021-10-06Revised runtime font managementJaakko Keränen
The built-in fonts are loaded via FontPack, and the font table is now constructed dynamically based on available fonts. A full set of variants (style, size) are prepared for each font, but some of the data gets allocated lazily when needed. GmRun needed a larger allocation for fonts, so now all the fields are combined into a single bit field. TODO: Glyph scaling, vertical offsets, and symbol lookup are still not fully working.
2021-10-05Started working on font packsJaakko Keränen
2021-10-01Text: Fixed a symbol for sizeJaakko Keränen
2021-10-01Added a 90% sized UI font for URL bar indicatorsJaakko Keränen
The 80% size is used in the toolbar.
2021-10-01Text: Added small size to symbol fontsJaakko Keränen
2021-09-21Text: Use 8-wide tabs; hide indicators for nowJaakko Keränen
2021-09-21Text: Draw tab indicators; jump to tab stopsJaakko Keränen
2021-09-20Experimenting with independent popup windowsJaakko Keränen
Toe dipping into multiple window support by allowing popup menu widgets to be displayed in independent windows. This is not a 100% replacement for native menus, but it gets pretty close.
2021-09-12Mobile: Draw optimizations; focus handlingJaakko Keränen
Widgets can now be marked for buffering their contents, which is useful if their contents change seldom but they are drawn often. For example, the navbar is always visible but doesn't change very often, and during animations menu contents are static but there is a moving animation so everything gets drawn 60 FPS. Focus handling was also improved so the lookup results can be scrolled while entering text, and one can tap outside an input field to unfocus it.
2021-08-25Merge branch 'dev' into work/v1.7Jaakko Keränen
# Conflicts: # CMakeLists.txt # res/about/version.gmi
2021-08-24Text: Character hit test vs. clustersJaakko Keränen
When multiple codepoints are in the same cluster, the hit test should only consider the first codepoint of the cluster, or otherwise the cursor is positioned somewhere in the middle of the cluster and not at the start.
2021-08-24InputWidget: Reverted an earlier change to fix cursor movement regressionJaakko Keränen
In word-wrapped lines, a character will be hit multiple times and the latest hit is what counts.
2021-08-20Added build options to force phone/tablet mobile UIJaakko Keränen
These options are mostly useful on mobile platforms that are not iOS or Android, and for testing purposes.
2021-08-20CleanupJaakko Keränen
2021-08-19InputWidget: Cursor behavior around invisible codepointsJaakko Keränen
Emoji variation selectors would confuse cursor positioning and insertion behavior, breaking the assumption that each line ends with a single newline.
2021-08-02Text: Fixed drawing wrapped text without HarfBuzzJaakko Keränen
2021-07-23InputWidget: Buffer contents not activeJaakko Keränen
2021-07-22CleanupJaakko Keränen
2021-07-22InputWidget: Sensitive input modeJaakko Keränen
At a low level when measuring/drawing text, replace all characters with an override character.
2021-07-21InputWidget: Fixed and reliabilityJaakko Keränen
Cursor movement and pasting.
2021-07-21InputWidget: Fixed coord-based positioningJaakko Keränen
2021-07-21Text: Finding the advance position of a characterJaakko Keränen
2021-07-21Revising InputWidget (continued)Jaakko Keränen
Finding cursor position via coordinates. Handling the mark. Visual wrapped lines vs. content lines. Vertical scrolling inside the visual range.
2021-07-20Text: Hit testing during a text runJaakko Keränen
2021-07-20Revising InputWidgetJaakko Keränen
`InputWidget` needs to be better at handling multiple lines. The previous implementation assumed that the content was short enough to be fully redrawn each frame, which is not a great idea when you have thousands of lines.
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