Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
DHaehnke

Junior Member
Registered:
Posts: 6
Reply with quote  #1 
Hi Jaewon,
 
as you might remember, we’re using a custom adapter to track the position of a wheel. The animal has to move the wheel in one direction by a certain amount. To see how close the animal is to its target, I added a color modulation of the dashboard text.
It’s using the RdYlGn map from color brewer and is becoming greener the closer the animal is to the threshold and redder the closer it is to the negative threshold.
When the colour is becoming closer to the green, the borders of the text look a bit weird, almost brown or red: 
MVIMG_20180913_150515_exported_stabilized_3822501191744613170.gif 
Is there some way to fix this or is this some MATLAB rendering issue?
 
Best wishes,
Daniel

0
Jaewon

Administrator
Registered:
Posts: 708
Reply with quote  #2 
It is because of truetype font hinting.

https://en.wikipedia.org/wiki/Font_hinting

But I don't know how Windows GDI draws fonts. You can either change to a different color or use monospace fonts, like Arial or Courier New.

To change the font, add the 'fontface' option to the DashBoard strings in Line 125 of mlscreen.m

mglsetproperty(obj.DashBoard,'fontface','Arial');
0
DHaehnke

Junior Member
Registered:
Posts: 6
Reply with quote  #3 
Thanks Jaewon, setting it to Arial helps. Would it be possible to add an option to do this in a less hacky way, so that we don't have to change it with every update of ML?
0
Jaewon

Administrator
Registered:
Posts: 708
Reply with quote  #4 
Download the new package. You can give that option in dashboard().

dashboard(1,'test',[0 1 0],'fontface','Arial');
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.