This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

  • Resolved

Linux/TMS320DM8127: Coloring OSD Text

Part Number: TMS320DM8127

Tool/software: Linux

In a previous thread - where I can't open up any new messages -  :

Hi Mechi,

There is only white color font having different size with YUV420SP Y and UV files which are available at Source/ipnc_rdk/ipnc_mcfw/mcfw/src_bios6/links_m3vpss/alg/sw_osd/fonts/.

You can use any color font by generating  YUV420SP Y and UV separate files and add it in Source/ipnc_rdk/ipnc_mcfw/mcfw/src_bios6/links_m3vpss/SRC_FILES.MK SRCS_SWOSD.

Regards,

Prashant

The characters that can be used for the OSD text are :

#define SWOSD_STRINGPATTERN "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz:; '/\\+-_()&$#.0123456789"

I understand that the files you mentioned contain the Y and UV data for these characters.

  • Is there a tool to make these files?
  • How are they arranged?
  • If I want to add a new character, is it possible?
  • If I want the text to sometimes be white and sometimes be red, how do I specify this? I can't imagine that making a new UV file for the red lettering, without adding to the source code of the SWOSD lib' the red text could be displayed.

Thanks for this important information - I will try to build a new RED font which will be used when red lettering is needed. Is this the way to proceed?

Thanks,

Mechi

  • Hi Mechi,

    You should be able now to reply in the original thread. Please continue the discussion on the original thread.

    Regards,
    Pavel



  • Hi Mechi,

    Steps to generate Y and UV text files:

    •  Open Paint and Create JPEG file with all characters having equal size(width). Here you need to use font color as red if you want red OSD fonts.
    •  Convert JPEG to YUV420SP and create separate Y and UV character array files.

    Need to write in sequence in SWOSD_STRINGPATTERN as per Y and UV files. Yes you can add new character but make sure you add it in SWOSD_STRINGPATTERN too.

    For your last point, You can change font color runtime as it is changing font size as per resolution. Here you need to write new API/case to change color(change to red font buffer address).

    Regards,
    Prashant
    Pathpartner Technology Pvt. Ltd.

  • In reply to Prashant A:

    How is this done?
    >> Convert JPEG to YUV420SP
  • In reply to Mechi Fendel:

    Hi,

    We have prepared 4 colored fonts. I need to use these fonts for different screen resolutions.

    Since memory is at a premium, I don't want to allocate more than is necessary. I was wondering why the fontDB is an array of 256 integers?

    int fontDB1232_Y1[256], fontDB1232_UV1[256];

    int fontDB1078_Y1[256], fontDB1078_UV1[256];

    I do not have the code for the function SWOSD_createFontDatabase that creates the Font Database.

    I do know that there are 77 characters - 

    #define SWOSD_STRINGPATTERN "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz:; '/\\+-_()&$#.0123456789"

    SWOSD_createFontDatabase(fontDB1078_Y1, fontDB1078_UV1, (char *) SWOSD_STRINGPATTERN, &fontInfo);

    I'm wondering if this is a set size that can't be changed? If I only want the 26 UPPERcase letters, can I save room in the fontDB arrays?

    Thanks,

    Mechi

  • In reply to Mechi Fendel:

    Hi Mechi,

    Yes, you can update SWOSD_STRINGPATTERN as per your requirement which will be used in     memcpy(fontBuff1232_Y1, YData_1232_30_WFONT_PURE,        SWOSD_STRINGWIDTH_1232_30 * SWOSD_CHARHEIGHT_1232_30);

    Here   SWOSD_STRINGWIDTH_1232_30 is SWOSD_STRINGPATTERN * SWOSD_CHARWIDTH_1232_30;

    I think fontDB1078_UV1[256] is max size. you can try with less array size.

    Regards,
    Prashant
    Pathpartner Technology Pvt. Ltd.

  • In reply to Prashant A:

    We succeeded in getting colored fonts...

    The picture is not in focus, but the OSD writing is apparent on top and bottom rows.

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.