Neodynamic ThermalLabel SDK 8.0+
Microsoft .NET Framework 4.6.1+
Microsoft Visual Studio 2017+
Any Zebra Thermal Printer supporting ZPL (Zebra Programming Language) or EPL (Eltron Programming Language)
Printing small text on thermal labels is a common request in some industries like Healthcare, Manufacturing, Retail, Security, Transportation, etc.
By printing small text, we mean text which font size is about 0.04 inch (about 1 millimiter) high. Printing such font size is not a problem at all if your thermal printer provides 300 or 600 dpi output printing resolution because you can use almost any TrueType font with the TextItem object and get a crisp and clear text after printing the label.
The problem arises if you are targeting or using a thermal printer which is 203 dpi. That resolution is commonly found on "Desktop thermal printers" although it is also found on "Midrange" and "High Performance" printers too. If your printer is 203 dpi, then getting a crisp and clear small text involves carefully selecting the TrueType font.
In ThermalLabel SDK we provide a solution to that scenario by using the so called "Bitmap or Pixel fonts". On any TextItem object, you enable these kind of fonts by setting up the IsBitmapFont property to True and specifying the correct size of the font using the Size and Unit properties.
We have made a couple of tests with some Bitmap/Pixel fonts available on the web. The following is the list of tested fonts and the minimum size for getting the smallest readable texts, mainly on 203 dpi printers:
The following code generates six TextItem objects featuring each font metioned above. Notice that IsBitmapFont property is set to True and the Unit and Size of the font are set up to the minimum size. The sample project is a Windows Forms app, which displays a preview of the generated thermal label at 203 dpi. This allows you to test how the TrueType font file will look like before printing.
Please follow up these steps:
Dim dpi As Double = 203
Dim sampleText As String = Me.textBox1.Text
Dim tLabel As New ThermalLabel(UnitType.Inch, 3, 2)
tLabel.GapLength = 0.1
Dim txt1 As New TextItem(0.1, 0.1, 2.8, 0.25, "")
txt1.Font.Name = "Arial"
txt1.Font.Unit = FontUnit.Point
txt1.Font.Size = 6
txt1.Text = txt1.Font.Name + ": " + sampleText
Dim txt2 As New TextItem(0.1, 0.35, 2.8, 0.25, "")
txt2.Font.CustomFontFile = "C:\temp\test_fonts\crisp.ttf"
txt2.Font.CustomFontFileFamilyName = "Crisp"
txt2.Font.IsBitmapFont = True
txt2.Font.Unit = FontUnit.Point
txt2.Font.Size = 6
txt2.Text = txt2.Font.CustomFontFileFamilyName + ": " + sampleText
Dim txt3 As New TextItem(0.1, 0.6, 2.8, 0.25, "")
txt3.Font.CustomFontFile = "C:\temp\test_fonts\MonteCarloFixed12.ttf"
txt3.Font.CustomFontFileFamilyName = "MonteCarlo Fixed 12"
txt3.Font.IsBitmapFont = True
txt3.Font.Unit = FontUnit.Point
txt3.Font.Size = 6
txt3.Text = txt3.Font.CustomFontFileFamilyName + ": " + sampleText
Dim txt3b As New TextItem(0.1, 0.85, 2.8, 0.25, "")
txt3b.Font.CustomFontFile = "C:\temp\test_fonts\MonteCarloFixed12-Bold.ttf"
txt3b.Font.CustomFontFileFamilyName = "MonteCarlo Fixed 12"
txt3b.Font.IsBitmapFont = True
txt3b.Font.Unit = FontUnit.Point
txt3b.Font.Size = 6
txt3b.Text = txt3b.Font.CustomFontFileFamilyName + ": " + sampleText
Dim txt4 As New TextItem(0.1, 1.1, 2.8, 0.25, "")
txt4.Font.CustomFontFile = "C:\temp\test_fonts\TEACPSS_.ttf"
txt4.Font.CustomFontFileFamilyName = "Teachers Pet Sans Serif"
txt4.Font.IsBitmapFont = True
txt4.Font.Unit = FontUnit.Point
txt4.Font.Size = 3
txt4.Text = txt4.Font.CustomFontFileFamilyName + ": " + sampleText
Dim txt4b As New TextItem(0.1, 1.35, 2.8, 0.25, "")
txt4b.Font.CustomFontFile = "C:\temp\test_fonts\TEACPSSB.ttf"
txt4b.Font.CustomFontFileFamilyName = "Teachers Pet Sans Serif Bold"
txt4b.Font.IsBitmapFont = True
txt4b.Font.Unit = FontUnit.Point
txt4b.Font.Size = 3
txt4b.Text = txt4b.Font.CustomFontFileFamilyName + ": " + sampleText
Dim txt5 As New TextItem(0.1, 1.6, 2.8, 0.25, "")
txt5.Font.CustomFontFile = "C:\temp\test_fonts\kharon.ttf"
txt5.Font.CustomFontFileFamilyName = "Kharon4a_v01"
txt5.Font.IsBitmapFont = True
txt5.Font.Unit = FontUnit.Point
txt5.Font.Size = 3
txt5.Text = txt5.Font.CustomFontFileFamilyName + ": " + sampleText
tLabel.Items.Add(txt1)
tLabel.Items.Add(txt2)
tLabel.Items.Add(txt3)
tLabel.Items.Add(txt3b)
tLabel.Items.Add(txt4)
tLabel.Items.Add(txt4b)
tLabel.Items.Add(txt5)
Using pj As New PrintJob()
Using ms As New System.IO.MemoryStream()
pj.ExportToImage(tLabel, ms, new ImageSettings(ImageFormat.Png), dpi)
Me.pictureBox1.Image = Image.FromStream(ms)
End Using
End Using
double dpi = 203;
string sampleText = this.textBox1.Text;
ThermalLabel tLabel = new ThermalLabel(UnitType.Inch, 3, 2);
tLabel.GapLength = 0.1;
TextItem txt1 = new TextItem(0.1, 0.1, 2.8, 0.25, "");
txt1.Font.Name = "Arial";
txt1.Font.Unit = FontUnit.Point;
txt1.Font.Size = 6;
txt1.Text = txt1.Font.Name + ": " + sampleText;
TextItem txt2 = new TextItem(0.1, 0.35, 2.8, 0.25, "");
txt2.Font.CustomFontFile = @"C:\temp\test_fonts\crisp.ttf";
txt2.Font.CustomFontFileFamilyName = "Crisp";
txt2.Font.IsBitmapFont = true;
txt2.Font.Unit = FontUnit.Point;
txt2.Font.Size = 6;
txt2.Text = txt2.Font.CustomFontFileFamilyName + ": " + sampleText;
TextItem txt3 = new TextItem(0.1, 0.6, 2.8, 0.25, "");
txt3.Font.CustomFontFile = @"C:\temp\test_fonts\MonteCarloFixed12.ttf";
txt3.Font.CustomFontFileFamilyName = "MonteCarlo Fixed 12";
txt3.Font.IsBitmapFont = true;
txt3.Font.Unit = FontUnit.Point;
txt3.Font.Size = 6;
txt3.Text = txt3.Font.CustomFontFileFamilyName + ": " + sampleText;
TextItem txt3b = new TextItem(0.1, 0.85, 2.8, 0.25, "");
txt3b.Font.CustomFontFile = @"C:\temp\test_fonts\MonteCarloFixed12-Bold.ttf";
txt3b.Font.CustomFontFileFamilyName = "MonteCarlo Fixed 12";
txt3b.Font.IsBitmapFont = true;
txt3b.Font.Unit = FontUnit.Point;
txt3b.Font.Size = 6;
txt3b.Text = txt3b.Font.CustomFontFileFamilyName + ": " + sampleText;
TextItem txt4 = new TextItem(0.1, 1.1, 2.8, 0.25, "");
txt4.Font.CustomFontFile = @"C:\temp\test_fonts\TEACPSS_.ttf";
txt4.Font.CustomFontFileFamilyName = "Teachers Pet Sans Serif";
txt4.Font.IsBitmapFont = true;
txt4.Font.Unit = FontUnit.Point;
txt4.Font.Size = 3;
txt4.Text = txt4.Font.CustomFontFileFamilyName + ": " + sampleText;
TextItem txt4b = new TextItem(0.1, 1.35, 2.8, 0.25, "");
txt4b.Font.CustomFontFile = @"C:\temp\test_fonts\TEACPSSB.ttf";
txt4b.Font.CustomFontFileFamilyName = "Teachers Pet Sans Serif Bold";
txt4b.Font.IsBitmapFont = true;
txt4b.Font.Unit = FontUnit.Point;
txt4b.Font.Size = 3;
txt4b.Text = txt4b.Font.CustomFontFileFamilyName + ": " + sampleText;
TextItem txt5 = new TextItem(0.1, 1.6, 2.8, 0.25, "");
txt5.Font.CustomFontFile = @"C:\temp\test_fonts\kharon.ttf";
txt5.Font.CustomFontFileFamilyName = "Kharon4a_v01";
txt5.Font.IsBitmapFont = true;
txt5.Font.Unit = FontUnit.Point;
txt5.Font.Size = 3;
txt5.Text = txt5.Font.CustomFontFileFamilyName + ": " + sampleText;
tLabel.Items.Add(txt1);
tLabel.Items.Add(txt2);
tLabel.Items.Add(txt3);
tLabel.Items.Add(txt3b);
tLabel.Items.Add(txt4);
tLabel.Items.Add(txt4b);
tLabel.Items.Add(txt5);
using (PrintJob pj = new PrintJob())
{
using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
{
pj.ExportToImage(tLabel, ms, new ImageSettings(ImageFormat.Png), dpi);
this.pictureBox1.Image = Image.FromStream(ms);
}
}
Based on the output image preview of the label, you get that at 203 dpi, each font/size settings give the following text height:
Conclusions
We provide best-in-class customer service and support directly from members of our dev team! If we are available when you contact us, you will get a response in few minutes; otherwise the maximum turnaround is 24hs in most cases.