Forward-port STL binary writer from master, pulling in horizontal position stuff.
[libsub.git] / src / stl_binary_reader.cc
index 8d7befb7bf60b7ebfc5b5ab0dbfe53ac2309296c..0c24a141188e40031b9bb418f416e639782ced9b 100644 (file)
@@ -110,6 +110,21 @@ STLBinaryReader::STLBinaryReader (istream& in)
                        sub.italic = italic;
                        sub.underline = underline;
 
+                       /* XXX: not sure what to do with JC = 0, "unchanged presentation" */
+                       int const h = get_int (14, 1);
+                       switch (h) {
+                       case 0:
+                       case 2:
+                               sub.horizontal_position = CENTRE;
+                               break;
+                       case 1:
+                               sub.horizontal_position = LEFT;
+                               break;
+                       case 3:
+                               sub.horizontal_position = RIGHT;
+                               break;
+                       }
+
                        /* Loop over characters */
                        string text;
                        for (size_t j = 0; j < lines[i].size(); ++j) {