Comments (4)
バージョンアップ版で確認しました。3つのフォントを表示して問題なく表示されています。
綺麗なフォント表示ができるようになりました。ありがとうございました。
http://remote.beruf.xyz/m5stack/P1030749s.jpg
from openfontrender.
検証途中ですが、進展があったので報告します。
フォントファイル容量が大きいため、ロードに失敗した可能性
サブセットフォントメーカーでASCIIのみに軽量化したフォントで検証した結果、症状改善せず。
よってフォントファイル容量が原因ではない
フォントのコード埋め込み時でも同様の症状が出るか
ttf2bin.py
によってコード埋め込みにした場合、両フォント(軽量化済み)は正常に表示。
よって、ファイルからの読み込み時にのみ症状が出る
以上の検証結果から、原因はファイル読み込みの部分だと考えられます。
おそらくファイル読み込み部分の処理がインスタンスごとに分けられていないため、
後からロードしたフォントで上書きされてしまっているのだと思います。
この問題に対応する予定ですが、おそらく時間がかかります。
しばらくの間、複数フォント利用時はコード埋め込みによる利用をしていただければと思います。
from openfontrender.
私の方でもその後色々調べていますが原因は見つけられていません。私もファイルアクセス辺りが怪しいと考えています。
例えば、下記の様にコードを書いてみると
ofr1.loadFont("/font/ShipporiMincho-Bold.ttf"); ofr1.setDrawer(M5.Lcd); ofr1.setFontSize(30); ofr1.setCursor(0, 0); ofr1.printf("1234"); ofr2.loadFont("/font/OpenSans-Bold.ttf"); ofr2.setDrawer(M5.Lcd); ofr1.setFontSize(30); ofr1.setCursor(0, 50); ofr1.printf("123456789"); ofr2.setFontSize(30); ofr2.setCursor(0, 100); ofr2.printf("12345678");
最初にofr1で、「1234]と出力したときにこの内容はキャッシュに残っているようで、
その後、ofr2.loadFont()を実行した後に、ofr1で「123456789」と出力すると、[1234」まで正常に
出力されて、それ以降はエラーで表示されなくなります。キャッシュにフォントが無いとき
ファイルに読みに行く辺りが原因かと疑っていますが、そこまでソースが追えていません。
コードへの埋め込みはまだ試していません。
from openfontrender.
対策を行ったバージョンをアップしました。
SDカードからの読み込みでも複数フォントを正常に表示できるようになったはずです。
お試しください。
from openfontrender.
Related Issues (20)
- unloadFont crashes ESP32 S3 when font file is in FLASH HOT 5
- Unable to use OpenFrontRender to use with TFT-eSPI HOT 18
- Meaning of error code HOT 2
- Text rendered below the cursor? HOT 3
- If no cache is set, it defaults to CACHE_SIZE_NO_LIMIT which will consume all available (heap) memory HOT 2
- Need some way to center text on screen HOT 6
- Font height is not computed correctly -- too short HOT 2
- Cursor x resting place calculated too far right after cprintf (w/ proposed solution) HOT 1
- tft_eSPI printf not using bg colour HOT 6
- FreeType Cache just keeps growing HOT 3
- [OFR ERROR] FTC_Manager_LookupFace error: 0x40 HOT 2
- Feature request: output to image file HOT 3
- Feature request: text wrap HOT 1
- SdFat support? HOT 2
- Please support ARM cortex arch? HOT 2
- Feature Request: Text outline support
- Feature request: loading fonts from SPIFFS/LittleFS HOT 4
- Compilation error using "setBackgroundFillMethod" HOT 1
- How can an integer be printed without sprintf HOT 2
- Compile fails in Arduino environment with master branch - develop branch crashes RP2040 HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openfontrender.