Thermal printer text font

Hello to everyone.
my problem is this. I am printing an article in thermal writing. When I write serial.write(largebyte) and serial.write(mediumbyte) code, it writes well, but when I write serial.write(smallbyte) code, the font is very bad and bold. how can i fix this. please don't recommend adafruit and softwareserial because I don't want to use those libraries I just want to fix it with arduino codes

Try to imagine that we have no idea what you're writing about.
Because we dont.

Now, back to you.

Please post an example sketch that illustrates the problem and so that we can see exactly what you are trying to print

Exactly what hardware are you using ?

Serial.write(mediumBytes,3);
Serial.println("overload");
This font is bold, how can I change it?

Please see reply #2

I want to measure weight and write it to thermal printer. but i want to change the thermal printer font and print some small

but i want to do this without using library

HINT: which thermal printer are you using - link to datasheet please.

I've packed my crystal ball away, so you're going to have to post your code for us to see as well.

If you don't provide more details as requested then providing help is probably impossible

#include "HX711.h"

int IN1 = A0;
int IN2 = A1;

int over_val;
int data;
int g_weight;
int Weight;
byte cutPaperFullBytes={0x1B, 0x69, NULL};
byte cutPaperPartialBytes={0x1D, 0x6D, NULL};
byte mediumUnderlineBytes={0x1B, 0x21, 0xA0, NULL};
byte mediumBytes={0x1B, 0x21, 0x20, NULL};
byte largeBytes={0x1B, 0x21, 0x30, NULL};
byte smallBytes={0x1B, 0x21, 0x21, NULL};
byte centerBytes={0x1B, 0x61, 0x01, NULL};
const int buzzer = 13;

void setup()
{
pinMode(buzzer, OUTPUT);

pinMode(IN1, INPUT);
pinMode(IN2, INPUT);

Serial.begin(9600);
Serial.print("Ready!\n");

}

void loop()
{

g_weight = Weight-data;

if (digitalRead(IN2) == LOW){data=Weight;}
if (digitalRead(IN1) == LOW){over_val=g_weight;}

if (g_weight<=over_val)
{

digitalWrite(buzzer,LOW);
}

else if (g_weight>over_val)
{
Serial.write(mediumBytes,3);
Serial.println("overload");

digitalWrite(buzzer,HIGH);
Serial.println(F(" "));
Serial.println(F(" "));
Serial.write(cutPaperFullBytes,2);
}

delay(50);
}

@programyerim did you get a warning that you were posting code improperly ?

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

sorry i don't know how to use this forum yet and i read the posts with google translate. I guess I can't get help here. I better seek help elsewhere. because I don't want to be annoying thanks

The language isn't important.
What you are NOT telling us IS important.

byte mediumBytes={0x1B, 0x21, 0x20, NULL};
byte largeBytes={0x1B, 0x21, 0x30, NULL};
byte smallBytes={0x1B, 0x21, 0x21, NULL};

Printer commands like this are called ESC/POS (Point-Of-Sale) commands. The Epson company originally created the commands for their thermal printers but many other companies use the same commands for their printers. The best option is to find a technical reference document for your brand and model of printer. But that is not possible, try the Epson technical reference.

https://www.epson-biz.com/modules/ref_escpos/index.php?content_id=2

The third byte is a bitmap that specifies font, wide, tall, emphasized (bold), and underline. For the smallest possible font, try with the 3rd byte equal to 0x00 or 0x01.

From what you've posted it appears the font looks fine to me.

Seriously, It is a common situation where folks starting here don't initially realize that to get an answer you must provide a relatively detailed description of the issue.

Realize we have no idea what "mediumbyte" is nor "smallbyte" are. We don't know what your are printing to and we don't know what you consider "Very bad and bold"