Patent ID: 7997815

Claim:
A printer comprising: a feeding device that feeds a tape-like print medium along a length direction of the print medium; a printing device that prints a character on the print medium; a storage device that stores original data including unit data, line feed data, and line height data, the unit data being data of a unit including at least one character, the line feed data specifying a separation position of a line of at least one unit to be printed on the print medium along the length direction, and the line height data indicating a height of the line of the at least one unit; a tape width detecting device that detects a tape width, the tape width being a width of the print medium in a direction perpendicular to the length direction; a maximum number of lines calculating device that calculates a maximum number of lines based on the line height data stored in the storage device and the tape width detected by the tape width detecting device, the maximum number of lines being a maximum number of lines that can be accommodated within the tape width when the height of the line of the at least one unit is unchanged; a print data generating device that generates print data corresponding, to the maximum number of lines calculated by the maximum number of lines calculating device from the original data stored in the storage device; and a printing control device that controls the printing device based on the print data generated by the print data generating device; a number of lines calculating device that calculates a number of lines of the at least one unit as an original number of lines based on a number of the line feed data stored in the storage device; and a number of lines determining device that compares the original number of lines calculated by the number of lines calculating device with the maximum number of lines calculated by the maximum number of lines calculating device to determine which is larger, wherein: the print data generating device generates the print data by adding to the original data the unit data corresponding to a number of lines obtained by subtracting the original number of lines from the maximum number of lines, when the number of lines determining device determines that the original number of lines is smaller than the maximum number of lines; and the print data generating device generates the print data by excluding from the original data the unit data corresponding to a number of lines obtained by subtracting the maximum number of lines, when the number of lines determining device determines that the original number of lines is larger than the maximum number of lines.