# Ameba Pro2 Font & Bitmap Tool Link / Documentation

**URL:** <https://forum.amebaiot.com/t/ameba-pro2-font-bitmap-tool-link-documentation/4406>\
**Category:** SDK\
**Tags:** rtl8735b\
**Created:** [October 21, 2025, 11:24am UTC](https://forum.amebaiot.com/t/ameba-pro2-font-bitmap-tool-link-documentation/4406 "2025-10-21T11:24:04Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![Pammy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/pammy/32/936_2.png) [@Pammy](https://forum.amebaiot.com/u/Pammy)\
**Post date:** [April 28, 2026, 4:03am UTC](https://forum.amebaiot.com/t/ameba-pro2-font-bitmap-tool-link-documentation/4406/21 "2026-04-28T04:03:24Z")

</div>

Hi @yugandhar,

Thank you for waiting.

With this script you can use to customize the text according to your preferences. You can adjust the following:

1. Text characters
2. Fonts
3. Colour and alpha value

 ![image](https://us1.discourse-cdn.com/flex016/uploads/ameba/original/2X/d/d9c05bf2229b2caee0cc2f85463e5457c56df438.png)

![image](https://us1.discourse-cdn.com/flex016/uploads/ameba/original/2X/1/14b978da8a1399c59b334bfbd5ef422c95d25d9b.png)

Kindly share the settings you’ve applied in your script and also the glyph folder that you have generated. I’ll get the header file for you first.

Script  
[generate\_glyph\_pngs.zip](https://forum.amebaiot.com/uploads/short-url/6rjhM2UO4qBzG5YItSrwQtWcCQZ.zip) (1.1 KB)

Example of glyphs folder  
[glyphs.zip](https://forum.amebaiot.com/uploads/short-url/nOvRposENtfiB7FvoWiW6vkYt9t.zip) (36.5 KB)

Thank you

---

<div class="post-metadata">

**Author:** ![yugandhar](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/yugandhar/32/2836_2.png) [@yugandhar](https://forum.amebaiot.com/u/yugandhar)\
**Post date:** [April 28, 2026, 6:38am UTC](https://forum.amebaiot.com/t/ameba-pro2-font-bitmap-tool-link-documentation/4406/22 "2026-04-28T06:38:59Z")

</div>

Hi @Pammy ,

In python script you shared, I can see font size(20) and glyph width(32), height(64). I think font size will be applied to draw the text which generates glyph image of specified width and height. Now what will be the font size I need to use in Ameba OSD API? is it 20(real font size applied) or 32(glyph width)? Please clear this confusion.

**Edit** : I attached the generated glyphs with different sizes. Please provide font header files for all szies I attached. We need to validate all font sizes.

Thanks,

Yugandhar

[glyphs\_roboto.zip](https://forum.amebaiot.com/uploads/short-url/olouUr3Vu8iD5ssigJLNAjMf4TM.zip) (260.4 KB)

---

<div class="post-metadata">

**Author:** ![Pammy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/pammy/32/936_2.png) [@Pammy](https://forum.amebaiot.com/u/Pammy)\
**Post date:** [April 28, 2026, 9:28am UTC](https://forum.amebaiot.com/t/ameba-pro2-font-bitmap-tool-link-documentation/4406/23 "2026-04-28T09:28:33Z")

</div>

Hi @yugandhar,

`FONT_SIZE = 20` is only used by Pillow to draw the character into the glyph image (32x64). It is recommended to use a glyph image size of 32×64 or larger. OSD pipeline is designed at 32×64 glyphs. The size of the text in the glyph image can be adjusted by `FONT_SIZE`.

> [@yugandhar](#):
>
> Now what will be the font size I need to use in Ameba OSD API?

Currently, the OSD text size is set to 28 (width) × 56 (height) slightly smaller than the glyph image size. I have tried example\_isp\_osd(0, 0, 32, 64); for the test .h file.

I’ve generated a sample header file for testing. You can try it out while I prepare other font sizes for further testing.

This is my updated PNG generation script, along with the settings I used for the test header file.

[generate\_glyph\_pngs.zip](https://forum.amebaiot.com/uploads/short-url/fJ4131Ui4i374pruwBxINrE0a6V.zip) (1.2 KB)

[custom\_font\_argb4444\_new.zip](https://forum.amebaiot.com/uploads/short-url/zAFmW7v9o5uPzp6EdLwuDArTIg5.zip) (35.5 KB)

Can I confirm your settings as follows,

> **Fonts:** Roboto  
> **Character Required -** 0123456789`~!@#$%^&\*()-=\_+,./;‘’\\<\>?:”{}|abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ  
> **Color:** draw.text((x, y), ch, font=font, fill=(255, 0, 0, 255))  
> **Requirements:** You need multiple font sizes for validation

---

<div class="post-metadata">

**Author:** ![yugandhar](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/yugandhar/32/2836_2.png) [@yugandhar](https://forum.amebaiot.com/u/yugandhar)\
**Post date:** [April 28, 2026, 9:52am UTC](https://forum.amebaiot.com/t/ameba-pro2-font-bitmap-tool-link-documentation/4406/24 "2026-04-28T09:52:37Z")

</div>

Hi @Pammy ,

I forgot to attach python script which has all required characters. Please use attached script file. The character set you mentioned has different characters for single quote and double quotes, I think those are not ASCII. Please check in attached python script for character set.

Are you using the glyphs I shared or you are generating again?

I am not convinced with font size in OSD API. I have a requirement to calculate the text width and adjust the (x,y) for proper alignment of OSD on screen. If the font data is generated from glyphs with 32x64, what are the **osd\_char\_w** and **osd\_char\_h** values in below struct which won’t use scaling.

```c
axOSDDateInfo[ix].font.osd_char_w = 32;
axOSDDateInfo[ix].font.osd_char_h = 64;

```

I am asking font data for different sizes to avoid scaling in OSD module. The scaling may generate wrong alpha values for glyphs with curves.

[generate\_glyph\_pngs\_roboto.zip](https://forum.amebaiot.com/uploads/short-url/tFE32OBPKm9RdKIORM6bqxDo5HZ.zip) (1.1 KB)

---

<div class="post-metadata">

**Author:** ![Pammy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/pammy/32/936_2.png) [@Pammy](https://forum.amebaiot.com/u/Pammy)\
**Post date:** [April 30, 2026, 10:05am UTC](https://forum.amebaiot.com/t/ameba-pro2-font-bitmap-tool-link-documentation/4406/25 "2026-04-30T10:05:57Z")

</div>

Hi @yugandhar,

> [@yugandhar](#):
>
> Are you using the glyphs I shared or you are generating again?

The header file I provided earlier is a test file from my generation; however, it uses the same fonts as yours, **Roboto Regular**. Currently, I’m in the process of getting the header files based on the images you provided.

> [@yugandhar](#):
>
> what are the **osd\_char\_w** and **osd\_char\_h** values in below struct which won’t use scaling.

To clear some doubts, and also verified with the team internally.

**`osd_char_w`** and **`osd_char_h`** can be configured as needed and represent the **target (scaled) output size** displayed on the video overlay.

The current OSD pipeline always performs a resize operation during OSD initialization, even when the source glyph size and the target size (`osd_char_w`, `osd_char_h`) are identical (e.g., 32×64 → 32×64). As a result, minor processing effects may still occur.

These values are passed into `rts_osd_init()`, where scaling is handled internally via `rts_set_char_size()`. This function takes the original font data from the header and rescales it to the specified dimensions (`osd_char_w`, `osd_char_h`).

To minimize quality loss (e.g., blurriness during scaling), it is recommended to use higher-resolution glyph images in the header, especially when scaling up is required.

While we are checking internally with the development team on the feasibility of a no-scaling solution, may I check if it would be possible for you to proceed with the current implementation in the meantime?

Do let us know if you have any enquires.

Thank you.

---

<div class="post-metadata">

**Author:** ![yugandhar](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/yugandhar/32/2836_2.png) [@yugandhar](https://forum.amebaiot.com/u/yugandhar)\
**Post date:** [May 1, 2026, 12:46pm UTC](https://forum.amebaiot.com/t/ameba-pro2-font-bitmap-tool-link-documentation/4406/26 "2026-05-01T12:46:36Z")

</div>

Hi @Pammy ,

Please provide the font data header file with the glyph images of highest resolution shared by me. If scaling effect applied in OSD module even though same font size used, there is no use of evaluating different font sizes.

Is there any plan to release the ARGB font generation tool to public? It is better if so, otherwise if I need to add any extra character, again I need to request and wait for some time.

Thanks,

Yugandhar

---

<div class="post-metadata">

**Author:** ![Pammy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/pammy/32/936_2.png) [@Pammy](https://forum.amebaiot.com/u/Pammy)\
**Post date:** [May 4, 2026, 10:16am UTC](https://forum.amebaiot.com/t/ameba-pro2-font-bitmap-tool-link-documentation/4406/27 "2026-05-04T10:16:25Z")

</div>

Hi @yugandhar,

I may need your help to provide the characters **“MmW@”** with `X_OFFSET` of -2, -4, -6, as I’m currently observing some clipping from the images.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/ameba/original/2X/9/95c430919af2f784087d4e3383124188a25ee3f2.jpeg)

Alternatively, you may also share the 32×64 font rendering settings you used, so I can fine-tune the characters on my side.

Please feel free to correct the configuration below if anything is not accurate:

[Roboto.zip](https://forum.amebaiot.com/uploads/short-url/8UL7lT22AixGztpLyZV3LbvaC3.zip) (7.6 MB)

Is this the font you are using?

```auto
GLYPH_W = 32
GLYPH_H = 64
CHARS = "MWm@"
FONT_PATH = "Roboto/Roboto/static/Roboto-Regular.ttf"
OUTPUT_DIR = Path("glyphs")
FONT_SIZE = 32
PAD_X = 6 
PAD_TOP = 12
PAD_BOTTOM = 10
X_OFFSET = -2

```

> [@yugandhar](#):
>
> elease the ARGB font generation tool to public

We do not have an official tool to generate ARGB4444 header files. However, I can share tools I’ve created to help preview characters for clipping issues and generate the header file after testing and finalizing.

Thank you.

---

<div class="post-metadata">

**Author:** ![yugandhar](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/yugandhar/32/2836_2.png) [@yugandhar](https://forum.amebaiot.com/u/yugandhar)\
**Post date:** [May 4, 2026, 11:15am UTC](https://forum.amebaiot.com/t/ameba-pro2-font-bitmap-tool-link-documentation/4406/28 "2026-05-04T11:15:06Z")

</div>

Hi @Pammy ,

I used same settings to generate glyphs. I just checked the glyphs I shared with 32x64 resolution and no clipping available in the png images, How the OSD module can clip them? And also, I can see characters like g, p, q, y, etc. are not positioned properly.

---

<div class="post-metadata">

**Author:** ![Pammy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/pammy/32/936_2.png) [@Pammy](https://forum.amebaiot.com/u/Pammy)\
**Post date:** [May 7, 2026, 10:15am UTC](https://forum.amebaiot.com/t/ameba-pro2-font-bitmap-tool-link-documentation/4406/29 "2026-05-07T10:15:44Z")

</div>

Hi @yugandhar,

The clipping happens after the PNGs are converted into the ARGB4444 font table and rendered by the OSD module.

Therefore, some fine tuning is needed during the PNG-to-ARGB4444 conversion process, especially for glyph alignment and positioning, which is done in the script that I have written.

`osd_char_w` , `osd_char_h` that i have tested are,

- 28 56
- 32 64
- 64 128

Kindly try the attached header file, which was tuned based on the image you provided. Do let me know if there’s any issue.  
[custom\_font\_argb4444.zip](https://forum.amebaiot.com/uploads/short-url/bc1Y4EzXUyL20jaf96XBvm2oIyd.zip) (27.5 KB)

The OSD module scales and renders the characters according to `osd_char_w` and `osd_char_h` . If the scaling, character spacing, or display area is not suitable, some characters may still appear clipped, so further fine-tuning may be needed.

You may let me know if you have any `osd_char_w` , `osd_char_h` in mind that you want to try so i can tune for you beforehand.

Thank you.

---

<div class="post-metadata">

**Author:** ![yugandhar](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/yugandhar/32/2836_2.png) [@yugandhar](https://forum.amebaiot.com/u/yugandhar)\
**Post date:** [May 14, 2026, 1:01pm UTC](https://forum.amebaiot.com/t/ameba-pro2-font-bitmap-tool-link-documentation/4406/30 "2026-05-14T13:01:11Z")

</div>

Hi @Pammy ,

When I try to use the custom font provided, I am getting below stack overflow errors continuously and program stopped working. I increased from 10KB to 30KB, still same issue. How to calculate the stack size of **rts\_osd\_task**? The font data is around 380KB, Is OSD task copies any amount of it to stack?

# === stack overflow ===

Task name : OSD, TCB : 70cfc640  
PSP 70fc3fd0 PSPLIM 70fa64c0  
MSP 20003fb0 MSPLIM 20003000

I verified the custom font data which is around 135KB provided in OSD example with 10KB stack size and it is working without any stack overflow errors, but I am seeing errors like **font of char 00000073 not exist.** This error is common if the characters are not found in font data. But, the major issue with OSD lib is **all OSDs are displayed with same color by omitting missed characters, even though I used different colors.** When I used my old 1bit font data with all characters, all OSDs displayed with correct colors. It looks like a bug in OSD module, can you provide a fix for this also.

Thanks,

Yugandhar

---

<div class="post-metadata">

**Author:** ![KevinKL](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/kevinkl/32/2632_2.png) [@KevinKL](https://forum.amebaiot.com/u/KevinKL)\
**Post date:** [August 3, 2026, 3:29am UTC](https://forum.amebaiot.com/t/ameba-pro2-font-bitmap-tool-link-documentation/4406/31 "2026-08-03T03:29:18Z")

</div>

Hi @yugandhar ,

Thank you for your patience. OSD font color replacement for ABGR4444 is now supported on FreeRTOS SDK. You may sync your local repository to the [latest version](https://github.com/Ameba-AIoT/ameba-rtos-pro2/commit/6b1944f0ff051b339147f05721f35243832477f1) for the updates. Please refer to the `osd_font_replacement_guide.md` for documentation and guidance.

Thank you.

[osd\_font\_color\_replacement\_guide.zip](https://forum.amebaiot.com/uploads/short-url/57fOZFQKBWk17gUpSsII4gMhFKC.zip) (4.6 KB)

---

<div class="post-metadata">

**Author:** ![KevinKL](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/kevinkl/32/2632_2.png) [@KevinKL](https://forum.amebaiot.com/u/KevinKL)\
**Post date:** [August 3, 2026, 5:39am UTC](https://forum.amebaiot.com/t/ameba-pro2-font-bitmap-tool-link-documentation/4406/32 "2026-08-03T05:39:37Z")

</div>

Hi @yugandhar ,

Alternatively, you may apply the following patch to your SDK to enable the color change feature.

Please update us after trying out the solution provided and let us know if there is any issue encountered.

Thank you.

[Patch\_Add\_color\_change\_support\_for\_abgr4444\_text\_(v01).zip](https://forum.amebaiot.com/uploads/short-url/y1BVQQf3jEavBQq2SPbrxFPTsMM.zip) (395.9 KB)

---

<div class="post-metadata">

**Author:** ![KevinKL](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/kevinkl/32/2632_2.png) [@KevinKL](https://forum.amebaiot.com/u/KevinKL)\
**Post date:** [August 13, 2026, 7:50am UTC](https://forum.amebaiot.com/t/ameba-pro2-font-bitmap-tool-link-documentation/4406/33 "2026-08-13T07:50:37Z")

</div>

Hi @yugandhar ,

We have updated the documentation for font color replacement. Kindly check it out [ISP — AmebaPro2's Documentation v0.1 documentation](https://ameba-doc-rtos-pro2-sdk.readthedocs-hosted.com/en/latest/application_note/15_ISP.html#osd-font-color-replacement)

Thank you.

[Previous page](https://forum.amebaiot.com/t/ameba-pro2-font-bitmap-tool-link-documentation/4406.md?page=1)
