Menu

#6 Font name not present in fo

open
nobody
None
5
2003-04-18
2003-04-18
Anonymous
No

Dear Sir,

Whenever we convert and html to fo file it doesn't take
the font name as a field from html file in <fo:block>
elment in fo file.

Please suggest how can we resolve this issue. My email
id is amit@kaushik.info

thanks & regards,
Amit Kaushik

Discussion

  • Csaba Fekszi

    Csaba Fekszi - 2003-07-23

    Logged In: YES
    user_id=828694

    Dear Enrico,

    Firstly I have to congratulate your html2fo and thank you
    horrible efforts you did so far!

    Refering the "Font name not present in fo" I have the same
    problem :
    I am losing the font type when convering html to fo with
    html2fo. For example

    converting this:

    <P align=center><FONT size=5><FONT face="Times New
    Roman">By law and<br>
    </FONT></P></FONT>

    the result is:

    <fo:block line-height="23pt" font-size="20pt" space-
    before.optimum="1.5pt" space-after.optimum="1.5pt" keep-
    together="always" text-align="center">By law and<fo:inline
    white-space-collapse="false">
    </fo:inline>
    </fo:block>

    The font-family="Arial" xsl:fo tag seems to be missing.

    Looking into the source I find that this issue possible has not
    been implemented yet.

    Would you please write me if you are planning to develop
    this function or suggest workaround how can I solve it or
    recommend actions to develop it?

    Thanks in advance!

    Bye

    Csaba Fekszi

     
  • Csaba Fekszi

    Csaba Fekszi - 2003-07-23

    Logged In: YES
    user_id=828694

    Hi everyone,

    First of all I have to apologize to Enrico, but I really need to
    convert html files to xsl:fo with working font face/font-family.

    That's why I made some changes on the source and it is
    working.

    Until the official release what solve this issue my solution is:

    1.) structs.c:

    ******place a new function into it
    :
    //fex begin new func
    char cptFontFace(tPTag pTag, tPProperty pProp)
    {
    tPPChar Value = &pProp->Value;
    char outc[30], *mv;

    /* it is ok if the sign after my value is not readable
    */
    mv = *Value;
    if (mv != NULL && strlen(mv)>0 ) {

    sprintf(outc, "%s", mv);

    fprintf(mylog, "New FontFace %s\n",
    AddPropertyValue
    (pTag, "STYLE-font-family", strdup(outc))->Value);

    return true;
    }
    else
    {
    fprintf(mylog, "No FontFace!\n");
    return false;
    }
    return false;
    }
    //fex end

    ******correct this line: SetupFont function
    :
    if (strmulticmp(pt->Type->Name,
    TG_FONTTAGS) == 0)
    {
    //fex begin
    //old: tpp = SearchProperty(pt, "XML-
    FONT-FACE");
    //fex new:
    tpp = SearchProperty(pt, "STYLE-
    font-family");
    //fex end

    2.) structs.h
    ******make available new func
    :
    //fex begin
    char cptFontFace(tPTag pTag, tPProperty pProp);
    //fex end

    3.) data.c
    *****give the reference of the new func in tPropertyType
    DefPropertyTypes[] at FACE tag
    :
    //fex begin
    //old: {"FACE" , NULL
    , "FONT\0" , NULL},
    //new:
    {"FACE" , NULL
    , "FONT\0" , &cptFontFace},
    //fex end

    //******add FACE tag to FONTTAGS at tTagGroup
    DefTagGroups[] =
    :
    {"%FONTTAGS;" , "XML-INLINE\0"
    "FONT\0"
    //fex begin
    //old:
    //new:
    "FACE\0"
    //fex end
    "CODE\0"
    "PRE\0"

    I hope that will help!

    Bye
    fex
    csfekszi@freemail.hu

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.