Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ An executable file named **"cbmtext"** will be generated: it's ready to use.

Synopsis:
```
cbmage <text file name>
cbmage -
cbmtext <text file name>
cbmtext -
```
This is the basic syntax: it will read the text file (first case), or from standard input (second case, giving "-" as parameter) writing on *standard output* (so, the terminal window) the raw bytes that should be interpreted by the **MPS 803** printer.

Expand Down
2 changes: 1 addition & 1 deletion source/cbmtext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void printText(ostream& out, istream& in) {

char* translate(uint32_t c, char *code) {
if (isSpace(c)) c = 32;
if (c >= 32 && c <= 127) {
if (c >= 32 && c <= 127) { // print doublequote as symbol
if (c >= 'A' && c <= 'Z') return singleChar(tolower(c), code);
if (c >= 'a' && c <= 'z') return singleChar(toupper(c), code);
list<char> chardef = charmap[c];
Expand Down
16 changes: 16 additions & 0 deletions source/chardefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ static list<char> missing_glyph = {
};

static unordered_map<uint32_t, list<char>> charmap = {
{L'"', {
0b010100,
0b010100,
0b010100,
0b000000,
0b000000,
0b000000,
0b000000 }},
{L'\\', {
0b100000,
0b100000,
Expand Down Expand Up @@ -319,6 +327,14 @@ static unordered_map<uint32_t, list<char>> charmap = {
0b111110,
0b100010,
0b100010 }},
{ L'Ä', {
0b100010,
0b011100,
0b100010,
0b100010,
0b111110,
0b100010,
0b100010 } },
{L'Â', {
0b011100,
0b000000,
Expand Down