What does it mean when my text is displayed as boxes?

22,735

Solution 1

Usually, that means that the unicode character specified isn't available in that particular font. Try changing fonts to one of the multinational ones, it should go away.

Solution 2

(t-shirt image from http://www.cafepress.com/nucleartacos.163046834)

The above image represents a common failure mode of text display systems that fail to take into account the full range of Unicode characters. On Windows platforms, characters that cannot be represented using any of the available fonts are represented with an open rectangle.

Solution 3

In Windows there are 2 common display problems that occur when trying to display Unicode characters:

  1. text sometimes appears as question marks

    • This occurs when Unicode data is converted to an 8-bit character set encoding (or technically multi-byte characters) usually via the system codepage (but other code pages can be specified in the conversion calls). If the target 8-bit character set doesn't included the characters needed, any characters not representable in the target character set get converted to question marks.
  2. text sometimes appears as boxes

    • This is a problem with the font not having the glpyh for a particular character. Boxes show up when there is a mismatch between Unicode characters in the document and those supported by the font. Specifically, the boxes represent characters not supported by the selected font.

Solution 4

The deal is that the text you are trying to display includes characters that are not supported in the font you are using. The box character is the default substitution character for Unicode text that does not have a glyph in the font.

On Windows, if you are trying to display text in a range of different languages, use a font such as Arial Unicode MS - this includes glyphs for a vast array of different languages. It is a "least common denominator" font - the glyphs will generally be there, but it generally lacks character and some of the glyphs will look a little weird next to each other.

Share:
22,735
1800 INFORMATION
Author by

1800 INFORMATION

Multitudinis imperitæ non formido judicia; meis tamen, rogo, parcant opusculis——in quibus fuit propositi semper, a jocis ad seria, a seriis vicissim ad jocos transire.

Updated on March 01, 2020

Comments

  • 1800 INFORMATION
    1800 INFORMATION about 4 years

    I'm attempting to display some text in my program using (say) Windows GDI and some of the unicode characters are displayed as boxes? What is up?

    See also: What does it mean when my text is displayed as Question Marks?

  • Kev
    Kev about 11 years
    Any chance you can expand this answer with a textual answer? That Cafe Press t-shirt might go away some day. Thanks.