summaryrefslogtreecommitdiff
path: root/src/gmdocument.h
AgeCommit message (Collapse)Author
2021-12-18Nicer image metadata and open URLs highlightJaakko Keränen
Metadata of inlined images shouldn't overlap the caption text. Open URL highlights are not drawn fullwidth to avoid clashing with side elements and generally to look more consistent.
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-10-29FontPack: Loading fonts from TTC filesJaakko 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-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-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-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-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-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-09-07Mobile: Redoing PreferencesJaakko Keränen
Contents of the Preferences split panel view are created based on arrays of MenuItems. This removes the confusing indirection of trying to modify the desktop widget tree to fit mobile.
2021-08-06GmDocument: Full-width images in narrow layoutJaakko Keränen
2021-07-17GmDocument: Link scheme flagsJaakko Keränen
A better way to keep track of the scheme used in a link.
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-12Update link visited status when navigatingJaakko Keränen
When an URL is visited, ensure that links to that URL update their visual state.
2021-06-15DocumentWidget: Caching error page documentsJaakko Keränen
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-21CleanupJaakko Keränen
2021-05-20Added GmTypesetterJaakko Keränen
2021-05-11Cache GmDocuments in memoryJaakko Keränen
Navigation history keeps final GmDocuments in memory for quicker restore when navigating; no need to redo layout. Changed the color escape to Vertical Tab so Carriage Returns can be left in the source, reducing need to normalize spaces.
2021-05-04Highlight links opened in other tabsJaakko Keränen
The primary purpose is to aid navigation in split view, so one can see exactly which links have been opened.
2021-04-15Progressive document renderingJaakko Keränen
VisBuf now guarantees that all the buffers are sequentially ordered. This ensure complete utilization of all the buffers. Previously some buffers were not used at all, or allocated to the same origin as another one (!). DocumentWidget is able to progressively fill up a buffer while scrolling. After any change to the visible region has been detected (and there are no ongoing changes), prerender the remaining runs one at a time. This solves the issue where one text run would be always unnecessarily rendered while scrolling, even if the scroll distance was just one pixel.
2021-03-29Improving alt text animation; cleaned up key shortcut labelsJaakko Keränen
Remove extra Plus signs from key shortcuts.
2021-03-28Folding preformatted blocks and showing alt textJaakko Keränen
The alt text of preformatted blocks is shown on mouse hover. The blocks can be clicked to toggle folding. IssueID #180
2021-03-27GmDocument: Finding position in sourceJaakko Keränen
The returned position at a source location is now a range, pointing to the left and right edges of the contacted character.
2021-03-18GmDocument: Trying out a footerJaakko Keränen
Currently disabled.
2021-03-16Translation: More reliable markup preservationJaakko Keränen
2021-03-12DocumentWidget: Bookmarking a wrapped linkJaakko Keränen
Only the clicked part of the label text was used for the bookmark.
2021-03-09GmDocument: Light mode Gray document themeJaakko Keränen
The Gray theme now has a light and dark variant.
2021-03-08Local Gemini links can use Emoji/symbol from label textJaakko Keränen
Instead of the default link icon, if a label starts with an Emoji or symbol, use that as the icon. This only works with local Gemini links so important information about link destination is not hidden.
2021-02-24GmDocument: Media type flexibilityJaakko Keränen
Allow defining new inline media types.
2021-01-02GmDocument: New link icon for Finger linksJaakko Keränen
Added a new link flag to identify Finger links so they can use their own icon.
2021-01-02Add support for Finger protocolJaakko Keränen
A patch courtesy of John Cowan. IssueID #106
2020-12-02Show a banner warning about certificate issuesJaakko Keränen
2020-11-30GmDocument: Special icon for query linksJaakko Keränen
2020-11-28Scrolling wide preformatted blocks horizontallyJaakko Keränen
Not entirely glitch-free but should be good enough for now. IssueID #44
2020-11-28Cleanup: Removed (hidden) preformatted wrap optionJaakko Keränen
2020-11-21DocumentWidget: Marking link icons as search matchesJaakko Keränen
2020-10-28Reporting TLS/SSL errorsJaakko Keränen
A proper error page is now shown if there is an error during the TLS request.
2020-10-20Added quote indicator preferenceJaakko Keränen
Also, added a command that gets posted when the mouse exits or enters the window area. This lets the hover outline to be updated accordingly.
2020-10-18Added more document color themesJaakko Keränen
The dark and light themes are now configurable in Preferences.
2020-10-04Working on audio playbackJaakko Keränen
Audio players are displayed the same way as images. When playing, a decoder runs in a background thread producing samples suitable for output.
2020-10-01Refactor: Separate media from GmDocumentJaakko Keränen
2020-09-25Document side elements; hover outlineJaakko Keränen
2020-09-22DocumentWidget: Drawing side elementsJaakko Keränen
The banner appears on the left, if there is room in the margin. Also added a document timestamp in the bottom to see when the data was received.
2020-09-21Added Prefs; placeholders for new optionsJaakko Keränen
2020-09-17Recognize and visualize "mailto:" linksJaakko Keränen
"mailto:" links now have their own icon and when clicked they open the URL in the default web browser. IssueID #5
2020-09-17DocumentWidget: Permanent imagesJaakko Keränen
A dynamically generated page showing nothing but an image should not be treated the same way as an inline image. I.e., disallow hiding the image on an image page.