summaryrefslogtreecommitdiff
path: root/src/gmdocument.c
AgeCommit message (Collapse)Author
2021-11-03Redo cached document layout if neededJaakko Keränen
Changing the fonts, zoom level, or window width will cause cached documents to be laid out again if they are restored from memory.
2021-11-02GmDocument: Remove heading line overlapJaakko Keränen
Spacing of heading lines was being reduced for a nicer appearance, but since backgrounds are erased behind text runs, it was causing issues with some fonts. Therefore this is disabled for now until I figure out how I want to fix the background issue. Maybe smarter clipping could be applied in the page renderer so that runs are only drawn once, and erasing the background becomes unnecessary? IssueID #364
2021-10-28GmDocument: Markdown regex tweakJaakko Keränen
2021-10-28GmDocument: Restore old themes after CRC-32 was fixedJaakko Keränen
The corrected CRC-32 function produces different theme seeds. This restores the old behavior.
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-25Banner: Error items; improved appearanceJaakko Keränen
2021-10-24Added BannerJaakko Keränen
Banner will take over everything related to the page top banner. DocumentWidget's content positioning is a bit messy, and now that the banner is no longer part of the GmDocument, it needed a bit of revising. It would still benefit from proper functions for mapping coordinates to/from the GmDocument coordinate space.
2021-10-24GmDocument: Fixed build issueJaakko Keränen
Use the standard `isdigit` from ctype.h.
2021-10-20GmDocument: "file://" is unthemedJaakko Keränen
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-18GmDocument: Fixed a potential crashJaakko Keränen
2021-10-17FontPack management via "about:fonts"Jaakko Keränen
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-15Preferences: Option to bold visited links, tooJaakko Keränen
Cleaned up serialization of the bool preferences a little.
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-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-11Merge branch 'dev' into work/v1.8Jaakko Keränen
# Conflicts: # CMakeLists.txt # res/lang/es.bin # res/lang/fr.bin # res/lang/gl.bin # res/lang/ie.bin # res/lang/ru.bin # res/lang/sk.bin # res/lang/sr.bin # res/lang/tok.bin # src/ui/documentwidget.c
2021-10-11DocumentWidget: Fixed text selection regressionsJaakko Keränen
The HarfBuzz and wrapped text changes introduced subtle differences in how text selection works. Fixed a bunch of issues regarding how the individual character selection mode works in edge cases. IssueID #357
2021-10-11Media refactoring; working on FontPack managementJaakko Keränen
Media still needs more work to get rid of redundancies and make lookups faster. FontPacks are manipulated as Media items (not unlike images) so they can be previewed on page, and installed via a click. FontPack management is not trivial as it includes such details as versioning and whether individual packs are enabled or disabled.
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-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-03GmDocument: Fixed a crash when selecting textJaakko Keränen
2021-09-24GmDocument: Image link iconJaakko Keränen
2021-09-17Mobile: About pageJaakko Keränen
2021-09-07Added image colorization preferenceJaakko Keränen
Option to colorize images to grayscale, text color, or preformatted color.
2021-08-20Added WebP decoding using libwebpJaakko Keränen
2021-08-06GmDocument: Full-width images in narrow layoutJaakko Keränen
2021-07-25CleanupJaakko Keränen
2021-07-17GmDocument: Avoid redundant envelope link iconJaakko Keränen
IssueID #312
2021-07-17GmDocument: Link scheme flagsJaakko Keränen
A better way to keep track of the scheme used in a link.
2021-07-15RTL line quote and link hover infoJaakko Keränen
2021-07-15GmDocument: Right-align RTL decorationsJaakko Keränen
2021-07-14GmDocument: Fixed lede font change on retryJaakko 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-12CleanupJaakko Keränen
2021-07-12GmDocument: CleanupJaakko Keränen
2021-07-12Update link visited status when navigatingJaakko Keränen
When an URL is visited, ensure that links to that URL update their visual state.
2021-07-11GmDocument: Big lede is all or nothingJaakko Keränen
Font size should not suddenly change halfway through a paragraph.
2021-07-11GmDocument: More efficient line wrappingJaakko Keränen
`WrapText` iterates over the wrapped line segments and does a callback on each one, without losing any work buffers and text shaping information along the way.
2021-07-11GmDocument: Refactoring line typesetterJaakko Keränen
The goal is to switch to `WrapText` so the entire paragraph can be processed in one go without having to re-initialize the HarfBuzz buffers after every wrap.
2021-07-11Preferences: Added setting for line spacingJaakko Keränen
IssueID #229
2021-07-06GmDocument: Ignore BOM if presentJaakko 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-02GmDocument: Tuning whitespaceJaakko Keränen
2021-07-02Gopher: Adjusted indentsJaakko Keränen