cancel
Showing results for 
Search instead for 
Did you mean: 

how can i display special unicode symbols like Upwards white Arrow (0x21E7) or Erase to the Left (0x232B)?

DJean.3
Associate II

to draw the unicode 'q' character for example we can use this instructions:

void CustomContainer::draw(const Rect& invalidatedArea) const{
  Font* font = FontManager::getFont(Typography::DEFAULT);
  if (font != 0){
    // Setup visuals for h-center of "string"
    LCD::StringVisuals visuals;
    visuals.font = font;
    visuals.alignment = CENTER;
    visuals.color = colortype(0xFF0000FF);
 
    Unicode::UnicodeChar character[2] = { 0, 0 }; 
    uint16_t fontHeight = font->getMinimumTextHeight();	
 
    Unicode::UnicodeChar c = 'q';
		if (c != 0){
				Rect Area1(50,20,40,20) ;
				uint16_t offset = (Area1.height - fontHeight) / 2;
 
				Rect invalidatedAreaRelative = Area1& invalidatedArea;
				Area1.y += offset;
				Area1.height -= offset;
				invalidatedAreaRelative.x -= Area1.x;
				invalidatedAreaRelative.y -= Area1.y;
	
				character[0] = c;
				translateRectToAbsolute(Area1);
				HAL::lcd().drawString(Area1, invalidatedAreaRelative, visuals, character);
		}		
	}
}

now how to display Unicode symbols like:

Upwards white Arrow ( Unicode 0x21E7)

Erase to the Left (Unicode = 0x232B )

or White Heavy Check Mark symbol (Unicode = 0x2705 )

This discussion is locked. Please start a new topic to ask your question.
0 REPLIES 0