^MT - Media Type
Declares whether the stock is direct thermal or needs a thermal-transfer ribbon.
^MT says which of the two imaging methods the loaded stock uses. Direct thermal
paper darkens under the printhead, and thermal transfer stock needs a ribbon to carry
ink onto it. It changes what the printer expects to find, not what
it draws, so it declares hardware rather than format.
Syntax
^MTaSupport
Accepted and skipped, because it configures the printer rather than the label. It cannot change the rendered output, and Labelary skips it too.
The parser stores this command as MtCommand, and nothing reads it. The choice decides whether the printer expects a ribbon, and the renderer has neither ribbon nor stock. The parser reads it, so the renderer reports no unsupported-command warning, unlike the unparsed media commands below. — not pinned by a test
Labelary renders this command.
Parameters
aMedia typerequired · one of a setnot honoured by zpl.toolsWhich imaging method the stock uses. An incorrect value on a printer gives a blank or ribbon-out label. In a render it changes nothing.
- Invalid value
- not possible — any value is accepted. The parser takes the whole remainder of the command instead of one comma-delimited argument, so
^MTD,Xgives the valueD,X. The parser accepts any word, and its own test asserts that^MTTHERMALparses. Nothing reads the result. - Test coverage
- No documented value is exercised by a test (D, T).
D- Direct thermal media, no ribbon
T- Thermal transfer media, ribbon required
Behavior
A printer shows the wrong value at once, in one of two ways:
Twith no ribbon loaded raises a ribbon-out error.Dwith a ribbon fitted wastes the ribbon, and the label prints from the paper's own coating.
The choice also decides whether ^JW, which sets ribbon tension, has anything to act
on.
The guide is explicit that a value must be entered, or the printer ignores the command.
The parser here is looser. It takes the whole remainder of the command rather than
one comma-delimited argument, so ^MTD,X gives the value D,X, and ^MTTHERMAL
parses as THERMAL. The parser's own unit test asserts exactly that. Nothing then
reads the value, so the renderer neither corrects nor reports an invalid media type.
Tested behavior
Differences from the specification
zpl.tools against the ZPL II guide
Where our renderer behaves differently from the specification.
- The parser puts the argument into
MtCommand. Nothing reads it. — not pinned by a test - The parser reads the rest of
^MTwithremaining()instead of one argument. It folds trailing text into the value and does not reject it. — not pinned by a test
Example
Thermal transfer stock declared in front of the label.
^XA
^MTT
^FO50,50^A0N,40,40^FDRibbon required^FS
^XZ
Related commands
^JWSet Ribbon TensionThis command sets the thermal-transfer ribbon tension.^MNMedia TrackingThis command tells the printer whether the stock is continuous, or has a gap, web or black mark between labels.^MFMedia FeedThis command sets what the printer does with the media at power-up and when the printhead closes.~SDSet DarknessSets the base print darkness level.