Skip to content

pcf: Use bitmaptools.readinto to load font data if available #41

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

Merged
merged 2 commits into from
Mar 18, 2021

Conversation

jepler
Copy link
Contributor

@jepler jepler commented Mar 14, 2021

Together with adafruit/circuitpython#4403 this speeds up loading bitmap fonts by up to 10x (for truly large fonts, like 72pt arial bold). Smaller font loading such as 12pt Arial Bold speeds up 2x. (when loading all ASCII glyphs 32..127 inclusive)

The code will continue to work on boards that don't have the new readinto function, at the same speed as before.

@ladyada ladyada requested a review from FoamyGuy March 14, 2021 19:07
@ladyada
Copy link
Member

ladyada commented Mar 14, 2021

@FoamyGuy you're doing a ton of font stuff so maybe ya can review this :) ?

@FoamyGuy
Copy link
Contributor

yep, I will check it out.

@jepler jepler marked this pull request as draft March 14, 2021 19:54
@jepler jepler marked this pull request as ready for review March 14, 2021 19:54
Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! Thank you @jepler

These changes look good to me. I tested without that change in the core and confirmed current behavior is working as intended. I successfully tested this with the change in the core on a Feather rp2040 with a 2.4" Fatherwing. I saw about 4x speed increase loading yasahsi-ascii-200.pcf font.

@jepler
Copy link
Contributor Author

jepler commented Mar 14, 2021

Thanks so much for testing! Let's wait for the core changes before merging this though.

@jepler jepler merged commit a3d7aed into adafruit:master Mar 18, 2021
@jepler jepler deleted the use-bitmaptools-readinto branch March 18, 2021 13:10
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Mar 20, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI to 3.5.7 from 3.5.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#128 from adafruit/anecdata-patch-2
  > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#126 from adafruit/anecdata-patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_LTR390 to 1.1.0 from 1.0.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_LTR390#3 from CedarGroveStudios/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bitmap_Font to 1.3.7 from 1.3.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_Bitmap_Font#41 from jepler/use-bitmaptools-readinto

Updating https://github.com/adafruit/Adafruit_CircuitPython_datetime to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_datetime#7 from brentru/fix-failing-tests
  > Merge pull request adafruit/Adafruit_CircuitPython_datetime#6 from cognitivegears/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad to 0.14.0 from 0.13.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_ImageLoad#45 from kmatch98/master
  > "Increase duplicate code check threshold "
  > Merge pull request adafruit/Adafruit_CircuitPython_ImageLoad#46 from adafruit/tests-linting

Updating https://github.com/adafruit/Adafruit_CircuitPython_Logging to 1.2.8 from 1.2.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_Logging#18 from dastels/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_Motor to 3.3.0 from 3.2.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_Motor#54 from CedarGroveStudios/master
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.

3 participants