ComputerCraft

ComputerCraft

21M Downloads

[1.76pr6] Char ID "160" should be solid white

lurr opened this issue ยท 2 comments

commented

Uh oh, a bug has appeared!

In sequential order, 160 should technically be a fully filled character. However, it is not!
When using the following code:

local s = ""
for i = 127,160 do
  s = s .. ("\\%3d"):format(i):gsub(" ","0")
  -- append \XXX to the end of the message, using some formatting trickery
  s = loadstring("return '" .. s .. "'")()
  -- Parse the \XXX at the end of the message
end

print("START" .. s .. "END")
-- Print out final string, with a start and an end to show issue.

It prints out this:
image

As you can see, the final character, right before END is blank - not following the pattern of the rest of the characters.

Character 160 is currently identical to character 128, which raises some concerns.
A simple fix, and would be nice for those trying to make 'engines' for the higher pixel characters, like me!

commented

term.setBackgroundColour(colours.white)
term.write("\128")

Character 160 presumably isn't intended as part of the "drawing" set at all, as chars 128 through to 159 (a range of 32 indexes) cover everything needed. See this thread for an excellent demonstration of the mechanics at play:

http://www.computercraft.info/forums2/index.php?/topic/25340-cc-176-easy-drawing-characters/

commented

Unicode character 160 is a "non breaking space": http://www.fileformat.info/info/unicode/char/00a0/index.htm
Therefore, it is left blank in the font file.

If you want to draw a solid character using the teletext symbols, draw char 128 with flipped text/background colours. You can access all of the absent subpixel combinations in this way.