1800 INFORMATION
1800 INFORMATION

Reputation: 135395

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

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?

Upvotes: 6

Views: 35021

Answers (5)

Jim
Jim

Reputation: 21

I had this same box/character/text issue for about 2 years on Chrome for Win10 and tried all suggested fixes but none worked for me. My problem was caused by an app I hadn't considered. I use uBlock Origin to cut-down on pop-up ads. By default, uBlock also "blocks remote fonts on this site", actually every site. When the fonts are blocked then Chrome inserts something to take its place, usually a simple square or rectangle. If nothing else has worked, check you ad blocker. That function can easily be turned off and all correct text is then displayed.

Upvotes: 2

Greg Hewgill
Greg Hewgill

Reputation: 994041

(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.

Upvotes: 15

Michael Burr
Michael Burr

Reputation: 340356

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.

Upvotes: 5

1800 INFORMATION
1800 INFORMATION

Reputation: 135395

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.

Upvotes: 2

Tim Howland
Tim Howland

Reputation: 7970

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.

Upvotes: 7

Related Questions