user85434: I am messing around with the Arduino TVout library and I have created some multi-character tiles (I don't know what else to call them). Just to start out, I created a simple X that spans across 4 characters but when I print them to the screen they align correctly.
How they should align:

How they really align:

Here is the code I have so far:
Main file:
#include "expressions.h"
#include <TVout.h>

TVout win;
unsigned char x = 0, y = 0;

void setup() {
  win.begin(NTSC);
  win.select_font(expr8x8);
}

void loop() {
  win.clear_screen();
  x = 2, y = 5;
  print_char(0, x, y);

  win.delay(1);
}

void print_char(char c, int startx, int starty) {
  int tmpx = startx, tmpy = starty;
  for (char i = c; i < c + 4; i++) {
    win.print_char(tmpx * 8, tmpy * 8, i);
    if (++tmpx == c + 2) {
      tmpy++;
      tmpx = startx;
    }
  }
}

expressions.h
#define EXPRESSIONS8x8_H

#include <avr/pgmspace.h>
extern const unsigned char expr8x8[];

expressions.cpp
#include "expressions.h"

PROGMEM const unsigned char expr8x8[] = {
  8, 8, 0, // width, height, start
 
  // broken
  0x00, 0x00, 0x30, 0x38, 0x1c, 0x1e, 0x07, 0x03,
  0x00, 0x00, 0x0c, 0x1c, 0x38, 0x70, 0xe0, 0xc0,
  0x03, 0x07, 0x0e, 0x1c, 0x38, 0x38, 0x00, 0x00,
  0xc0, 0xc0, 0x70, 0x38, 0x1c, 0x0c, 0x00, 0x00,

  // happy
  0x00, 0x00, 0x00, 0x00, 0x07, 0x1f, 0x38, 0x70,
  0x00, 0x00, 0x00, 0x00, 0xe0, 0xf8, 0x1c, 0x0e,
  0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00
};

Is there something I am doing wrong? How do I fix this bug/issue?

user7508: I believe your problem is in this line:
if (++tmpx == c + 2) {

Here you are mixing two different things:

c is a character code, i.e. the index of a glyph within the
expr8x8 font
tmpx is the index of a character cell (a 8×8 block of pixels) within
a line of the screen

Comparing those makes little sense. And in fact, the comparison will
always be false, as c is zero, and tmpx starts at 2 and increases
from there.
I guess what you meant was:
if (++tmpx == startx + 2) {


85434: <p>I am messing around with the Arduino TVout library and I have created some multi-character tiles (I don't know what else to call them). Just to start out, I created a simple X that spans across 4 characters but when I print them to the screen they align correctly.</p>
<p>How they should align:<br />
<img src="https://i.stack.imgur.com/j4XMt.png" /></p>
<p>How they really align:<br />
<img src="https://i.stack.imgur.com/hccNk.jpg" width="200" /></p>
<p>Here is the code I have so far:</p>
<p>Main file:</p>
<pre class="lang-cpp prettyprint-override"><code>#include &quot;expressions.h&quot;
#include &lt;TVout.h&gt;

TVout win;
unsigned char x = 0, y = 0;

void setup() {
  win.begin(NTSC);
  win.select_font(expr8x8);
}

void loop() {
  win.clear_screen();
  x = 2, y = 5;
  print_char(0, x, y);

  win.delay(1);
}

void print_char(char c, int startx, int starty) {
  int tmpx = startx, tmpy = starty;
  for (char i = c; i &lt; c + 4; i++) {
    win.print_char(tmpx * 8, tmpy * 8, i);
    if (++tmpx == c + 2) {
      tmpy++;
      tmpx = startx;
    }
  }
}
</code></pre>
<p>expressions.h</p>
<pre><code>#define EXPRESSIONS8x8_H

#include &lt;avr/pgmspace.h&gt;
extern const unsigned char expr8x8[];
</code></pre>
<p>expressions.cpp</p>
<pre class="lang-cpp prettyprint-override"><code>#include &quot;expressions.h&quot;

PROGMEM const unsigned char expr8x8[] = {
  8, 8, 0, // width, height, start
 
  // broken
  0x00, 0x00, 0x30, 0x38, 0x1c, 0x1e, 0x07, 0x03,
  0x00, 0x00, 0x0c, 0x1c, 0x38, 0x70, 0xe0, 0xc0,
  0x03, 0x07, 0x0e, 0x1c, 0x38, 0x38, 0x00, 0x00,
  0xc0, 0xc0, 0x70, 0x38, 0x1c, 0x0c, 0x00, 0x00,

  // happy
  0x00, 0x00, 0x00, 0x00, 0x07, 0x1f, 0x38, 0x70,
  0x00, 0x00, 0x00, 0x00, 0xe0, 0xf8, 0x1c, 0x0e,
  0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00
};
</code></pre>
<p>Is there something I am doing wrong? How do I fix this bug/issue?</p>
 7508: <p>I believe your problem is in this line:</p>
<pre class="lang-cpp prettyprint-override"><code>if (++tmpx == c + 2) {
</code></pre>
<p>Here you are mixing two different things:</p>
<ul>
<li><code>c</code> is a character code, i.e. the index of a glyph within the
<code>expr8x8</code> font</li>
<li><code>tmpx</code> is the index of a character cell (a 8×8 block of pixels) within
a line of the screen</li>
</ul>
<p>Comparing those makes little sense. And in fact, the comparison will
always be false, as <code>c</code> is zero, and <code>tmpx</code> starts at 2 and increases
from there.</p>
<p>I guess what you meant was:</p>
<pre class="lang-cpp prettyprint-override"><code>if (++tmpx == startx + 2) {
</code></pre>
