我通过我的安卓手机将文本发送到蓝牙打印机。打印机和我的设备都通过蓝牙连接。
我的问题是:
打印机正在使用文本的默认字体大小
,我想要改变要打印的文本的字体大小。
我该如何实现呢?
这是我打印文本代码与蓝牙连接之后的样子:
private void connect_print(BluetoothDevice bluetoothDevicess) {
// some code
printData();
// some code
}
printData() 方法
private void printData() {
// TODO Auto-generated method stub
String str = new String("This is the text sending to the printer");
String newline = "\n";
try {
out.write(str.getBytes(),0,str.getBytes().length);
Log.i("Log", "One line printed");
} catch (IOException e) {
Toast.makeText(BluetoothDemo.this, "catch 1", Toast.LENGTH_LONG).show();
e.printStackTrace();
Log.i("Log", "unable to write ");
flagCheck = false;
}
try {
out.write(newline.getBytes(),0,newline.getBytes().length);
} catch (IOException e) {
Log.i("Log", "Unable to write the new line::");
e.printStackTrace();
flagCheck = false;
}
flagCheck = true;
}
我想改变发送到打印机打印的文本的字体大小
和字体样式
。请帮我实现这个目标。如果有人能提供任何链接,我也将不胜感激。
帮助我找到解决这个问题的方法