Color difference between drawRect and drawString #1458
Replies: 9 comments
-
Posted at 2021-05-12 by @fanoush oh, cool, was fighting with this or something very similar some time ago but with bitmap vs vector font, had 4 bit buffer and last color was white and had to do |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-05-12 by @gfwilliams Wow, this is an odd one. Thanks for letting me know! You can do this in the emulator:
I think this is related to custom fonts. If you use a built-in or vector you should be ok? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-05-12 by JumJum Thats crazy, with Vector font color is green, as expected |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-05-12 by @fanoush strange, when I hit the issue I asked jeffmer if he can replicate and it was ok for him |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-05-12 by JumJum Checked with font 6x8, 4x6, Vector and all work fine. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-05-12 by @fanoush Most probably it is any custom font - one made by setCustomFont. 6x8, 4x6, Vector are all built-in special cases, not custom ones. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-05-13 by JumJum There is a special handling for custom fonts in jswrap_graphics #1471 to #1476. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-05-13 by @gfwilliams Ahh, ok - so custom fonts were tweaked a while back to allow the use of antialiased fonts - so rather than just 1BPP, 2 or 4. You can see what happens if you change the BPP in http://www.espruino.com/Font+Converter I'll see about getting a fix in now |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-05-13 by @gfwilliams Ok, if you pull now it's fixed! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2021-05-12 by JumJum
strange behaviour with color.
With source below, text is blue and rect is green
Looks like drawString expects color from 1 to 8 and drawRect expects 0 to 7
Beta Was this translation helpful? Give feedback.
All reactions