UniPRT SDK v2.0.0.0
 
Loading...
Searching...
No Matches
Utilities Class Reference

A utility class providing helper functions for TSPL operations. More...

#include <Utilities.h>

Inheritance diagram for Utilities:

Class Methods

(NSData *) + TsplWindowsFontWithImageName:fontSize:rotation:fontStyle:fontFamilyName:content:
 Renders text as 1bpp BMP data wrapped in a TSPL DOWNLOAD command.
 

Detailed Description

A utility class providing helper functions for TSPL operations.

This class contains static methods that support font and image handling for TSPL printing commands.

Method Documentation

◆ TsplWindowsFontWithImageName:fontSize:rotation:fontStyle:fontFamilyName:content:

+ (NSData *) TsplWindowsFontWithImageName: (NSString *) imageName
fontSize: (NSInteger) fontSize
rotation: (NSInteger) rotation
fontStyle: (NSInteger) fontStyle
fontFamilyName: (NSString *) fontFamilyName
content: (NSString *) content 

Renders text as 1bpp BMP data wrapped in a TSPL DOWNLOAD command.

This method converts the given text into monochrome bitmap data using the specified Windows font attributes (family, size, style, rotation). The result is wrapped into a TSPL DOWNLOAD command that can be sent to the printer.

Parameters
imageNameThe image name without extension.
fontSizeThe font size in points.
rotationThe rotation angle of the font (degrees: 0, 90, 180, 270).
fontStyleThe font style:
  • 0: Normal
  • 1: Bold
  • 2: Italic
  • 3: Bold + Italic
fontFamilyNameThe name of the font family (e.g., Helvetica).
contentThe text to render.
Returns
An NSData object containing the TSPL DOWNLOAD command with embedded BMP data.

The documentation for this class was generated from the following file: