Groups > dBase > dBase reports > Re: Fonts in HTML




Fonts in HTML

Fonts in HTML
Thu, 27 Dec 2007 05:19:11 -050
Hi,
I have tried hard to get a HTML-file with another font than the normal 'Times
new roman', but have not yet succeded.
I use for example:
   this.STREAMSOURCE1.detailBand.TEXTENHED1 = new
TEXT(this.STREAMSOURCE1.detailBand)
   with (this.STREAMSOURCE1.detailBand.TEXTENHED1)
      height = 285.0
      left = 2800
      top = 0.0
      width = 1200
      variableHeight = true
      prefixEnable = false
      colorNormal = "blue/BtnFace"
      fontName = "Comic Sans MS"
      fontSize = 9.0
      fontBold = true
      text = {||this.form.rep1.rowset.fields["enhed"].value}
   endwith

but it does not change the font.
Do anyone have an idea to that.
Happy new year
Post Reply
Re: Fonts in HTML
Thu, 27 Dec 2007 05:35:10 -080
Peter Krarup wrote:
> Hi,
> I have tried hard to get a HTML-file with another font than the normal
'Times new roman', but have not yet succeded.
> I use for example:
>    this.STREAMSOURCE1.detailBand.TEXTENHED1 = new
TEXT(this.STREAMSOURCE1.detailBand)
>    with (this.STREAMSOURCE1.detailBand.TEXTENHED1)
>       height = 285.0
>       left = 2800
>       top = 0.0
>       width = 1200
>       variableHeight = true
>       prefixEnable = false
>       colorNormal = "blue/BtnFace"
>       fontName = "Comic Sans MS"
>       fontSize = 9.0
>       fontBold = true
>       text = {||this.form.rep1.rowset.fields["enhed"].value}
>    endwith
> 
> but it does not change the font.
> Do anyone have an idea to that.

You will most likely need to do it manually, by adding code to the 
canRender event ... the problem here is that dBASE does not stream out 
many of the HTML properties that you might like for an HTML report:

function TEXTENHED1_canRender
    f = form.streamSource1.rowset.fields
    this.text := [<font face="Comic Sans
MS">]+f["enhed"].value+[</font>]
return true

Or something like that ...

Ken

-- 
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
Post Reply
Re: Fonts in HTML
Tue, 05 Feb 2008 08:34:33 -080
I believe I responded to this. If not, I apologize.

The report designer does not stream out everything you might like it to 
when generating HTML.

If you want to change the font, the simplest solution is to insert the 
font tag in the text being output. I suggest using the canRender event 
handler:

function TEXTENHED1_canRender
    // something like:
    this.text := [<font face="Comic Sans MS" color="blue"
size="9pt">]+;
                 this.text+[</font>]
    // or
//   this.text := [<span style="font:Comic Sans MS; font-size: 9pt; 
color: blue;">]+;
                 this.text+[</span>]
return true

The "span" tag allows for styles in HTML, which is in a lot of
people's 
eyes the better way to go ...

Ken


Peter Krarup wrote:
> I had hoped on an answer to my question but it looks as there is no
solution to my problem.
> Kind regards
> Peter Krarup
> 
> 
> Peter Krarup Wrote:
> 
>> Hi,
>> I have tried hard to get a HTML-file with another font than the normal
'Times new roman', but have not yet succeded.
>> I use for example:
>>    this.STREAMSOURCE1.detailBand.TEXTENHED1 = new
TEXT(this.STREAMSOURCE1.detailBand)
>>    with (this.STREAMSOURCE1.detailBand.TEXTENHED1)
>>       height = 285.0
>>       left = 2800
>>       top = 0.0
>>       width = 1200
>>       variableHeight = true
>>       prefixEnable = false
>>       colorNormal = "blue/BtnFace"
>>       fontName = "Comic Sans MS"
>>       fontSize = 9.0
>>       fontBold = true
>>       text = {||this.form.rep1.rowset.fields["enhed"].value}
>>    endwith
>>
>> but it does not change the font.
>> Do anyone have an idea to that.
>> Happy new year
>> Peter Krarup
> 


-- 
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
Post Reply
Re: Fonts in HTML
Tue, 05 Feb 2008 11:06:54 -050
I had hoped on an answer to my question but it looks as there is no solution to
my problem.
Kind regards
Peter Krarup


Peter Krarup Wrote:

> Hi,
> I have tried hard to get a HTML-file with another font than the normal
'Times new roman', but have not yet succeded.
> I use for example:
>    this.STREAMSOURCE1.detailBand.TEXTENHED1 = new
TEXT(this.STREAMSOURCE1.detailBand)
>    with (this.STREAMSOURCE1.detailBand.TEXTENHED1)
>       height = 285.0
>       left = 2800
>       top = 0.0
>       width = 1200
>       variableHeight = true
>       prefixEnable = false
>       colorNormal = "blue/BtnFace"
>       fontName = "Comic Sans MS"
>       fontSize = 9.0
>       fontBold = true
>       text = {||this.form.rep1.rowset.fields["enhed"].value}
>    endwith
> 
> but it does not change the font.
> Do anyone have an idea to that.
> Happy new year
> Peter Krarup
Post Reply
Re: Fonts in HTML
Tue, 05 Feb 2008 11:25:47 -080
Ivar B. Jessen wrote:
> On Tue, 05 Feb 2008 11:06:54 -0500, in dbase.reports, 
> Subject: Re: Fonts in HTML, 
> Message-ID: <T5hTgEBaIHA.1240@news-server>,  
> Peter Krarup <pk@force.dk> wrote:
> 
>> I had hoped on an answer to my question but it looks as there is no
solution to my problem.
>> Kind regards
>> Peter Krarup
> 
> 
> Run the code below my signature. It opens Fish.rep from the samples folder,
and the fish names are
> displayed in the font you wanted. I changed the font color to red in order
to let the new font stand
> out.

The problem is output to HTML from the report engine ... it doesn't 
stream out everything one might expect.

Ken

-- 
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
Post Reply
<< Previous 1 2 3 4 Next >>
( Page 1 of 4 )
about | contact