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

[QP] Native palette support for fonts #20645

Merged
merged 6 commits into from
Feb 16, 2024
Merged

Conversation

elpekenin
Copy link
Contributor

@elpekenin elpekenin commented Apr 30, 2023

Description

PR for native colors on assets didn't update the code for rendering texts, only images, causing some lock ups. To prevent code duplication (and similar issues in the future) i've moved the code into a new function which wraps the two appenders(pixel and byte variants).

I don't like the chosen name very much, im open to suggestions

PS: Can fonts be coloured anyway?

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added the core label Apr 30, 2023
quantum/painter/qp_draw_text.c Outdated Show resolved Hide resolved
quantum/painter/qp_draw_image.c Outdated Show resolved Hide resolved
quantum/painter/qp_draw.h Outdated Show resolved Hide resolved
@tzarc
Copy link
Member

tzarc commented Apr 30, 2023

PS: Can fonts be coloured anyway?

Yes, can create a font image however you like, that's why it's a 2-stage process.

See https://cdn.discordapp.com/attachments/587004793004884086/1102385305656492133/font.mp4

Adapted from: https://github.com/ianhan/BitmapFonts/blob/main/32X32-FA.png

@elpekenin
Copy link
Contributor Author

Yeah, bad wording... What i was actually wondering is whether the .ttf(and friends) files can store colors.
Users can definitely change the intermediate font image if they want to

@github-actions
Copy link

Thank you for your contribution!
This pull request has been automatically marked as stale because it has not had activity in the last 45 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, or re-open when it's ready.
For maintainers: Please label with bug, awaiting review, breaking_change, in progress, or on hold to prevent the issue from being re-flagged.

@github-actions github-actions bot added the stale Issues or pull requests that have become inactive without resolution. label Aug 25, 2023
@tzarc tzarc added awaiting review and removed stale Issues or pull requests that have become inactive without resolution. labels Aug 25, 2023
@elpekenin
Copy link
Contributor Author

For what is worth.. i've been running this for a couple months and i didnt notice any issues drawing either images(non-native ones) or fonts(both native and not).

Will try and use a native image tomorrow for the sake of completeness and report back (if i dont forget to test)

@elpekenin
Copy link
Contributor Author

Just confirmed native image too. Replaced an image from mono2 to rgb565 and i dont see any difference.

@drashna drashna requested review from tzarc and a team September 14, 2023 08:23
@drashna drashna requested a review from a team December 6, 2023 06:35
@tzarc tzarc changed the title [Bugfix + Refactor] Native palette support for fonts [QP] Native palette support for fonts Feb 16, 2024
@tzarc tzarc merged commit 3a0f11a into qmk:develop Feb 16, 2024
4 checks passed
@elpekenin elpekenin deleted the fix/native-font branch February 16, 2024 13:59
thebengeu pushed a commit to thebengeu/qmk_firmware that referenced this pull request Apr 21, 2024
Mesabloo pushed a commit to Mesabloo/qmk_firmware that referenced this pull request May 27, 2024
AJO-Python pushed a commit to AJO-Python/qmk_firmware that referenced this pull request Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants