Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple font sizes #235

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

nicoburns
Copy link
Contributor

@nicoburns nicoburns commented Feb 19, 2024

Implement specifying multiple font sizes and/or line heights.

Current status

Basic layout functionality is working, but it needs a bit of a rework (possibly involving some API design work). Additionally, scrolling / editing are not currently working correctly.

Todo

  • fix scrolling
  • implement enum LineHeight
  • cache line_heights()
  • retire Metrics
  • rebase main merged into branch. Will need to squash prior to merge.
  • migrate tests
  • migrate benches
  • migrate example terminal (NOTE: does not compile on Windows with termion, see Update terminal example using colored` #129)
  • Fix:
    • Empty lines not displaying (due to no styles / line height applying)
    • Scrolling when buffer is smaller than number of lines (may be a bug in resize / shape functions)
    • Editor example: fix rescaling font sizes on demand (perhaps via mutable access to spans of Attrs)
    • Functionality using the visible_lines functionality (shape_until_scroll, shape_until_cursor)
    • Vi Editor
    • Editor action Vertical (may now be working but need to check)
  • Add:
    • scale_factor field to Buffer (this is necessary to deal with scale factor changes (e.g. when moving windows between displays) ergonomically now that font_size is not buffer-global)
    • Default Attrs for a Buffer
  • Docs

Questions:

  • Should the Hash impl of Attrs include line height?

Fix conflicts

cargo fmt

Fix terminal example

Make rich-text example compile

Make multiview example compile

WIP

Fix scaling in multiview example

Add rich-text-winit example

Swap color channels

Remove unused code in rich-text-winit example

cargo fmt

Fix LayoutRunIter

Fix size_hint method of LayoutRunIter

Cargo fmt

Fix wrap tests

Fix doctests

Set font size in editor-orbclient example

Port editor example to winit

Implement scroll logic + add shape_as_needed

request redraw on click

Handle text input using named keys

cargo fmt

Implement dragging

Refactor winit event handlers to avoid duplication

Remove commented code

Remove dbg and printlns

Fix unused import/variable warnings

Revert editor changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spans of font sizes
1 participant