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

Retrofitted to pure Rust #58

Merged
merged 11 commits into from
Nov 13, 2023
Merged

Retrofitted to pure Rust #58

merged 11 commits into from
Nov 13, 2023

Conversation

7sDream
Copy link
Owner

@7sDream 7sDream commented Nov 12, 2023

A few days ago, I opted to use fontconfig and freetype for this task, as I was operating in a macOS/Linux environment. However, the native Linux technology had issues, such as static linking not functioning in macOS (See #10), which led me to consider a macOS native technology (CoreText, See #18). This approach, however, required a deep understanding of the system API, and to be frank, I’m not a fan of Objective C.

Currently, I primarily use a Windows PC during my non-working hours, and this small tool remains crucial for my typography and writing projects. Therefore, I’ve decided to transition to a pure Rust implementation, with the assistance of the excellent crates, fontdb and ab-glyph.

I’ve already made some progress, such as updating and fixing clippy/rustfmt, upgrading the Rust edition, cleaning up dependencies, and so on. I’ve also commenced the rewriting process:

  • workspace
    • edition 2018 -> 2021
    • rustfmt configure, error fix
    • clippy configure, error fix
  • dependencies
    • remove: fontconfig, freetype
    • update: many
    • change: tui -> ratatui
  • use fontdb to load system fonts
  • filter font faces contains the asked character
  • group by family and sort by name rewrite
  • make the list display mode works 🥳
  • make the browser preview works 🥳
  • use ab-glyph(or other) to resterize font
    • figure out how to set size
    • 256 alpha mode
    • mono mode
  • make the tui preview works 🥳
  • update README, Changelog

Current state: all feature works.

@7sDream 7sDream marked this pull request as draft November 12, 2023 20:49
@7sDream 7sDream marked this pull request as ready for review November 13, 2023 14:19
@7sDream 7sDream changed the title [WIP] Retrofitted to pure Rust Retrofitted to pure Rust Nov 13, 2023
@7sDream 7sDream merged commit b0f6d09 into master Nov 13, 2023
10 checks passed
@7sDream 7sDream deleted the purerust branch November 14, 2023 02:39
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.

1 participant