POV-Ray : Newsgroups : povray.general : Wanted: dealing with font style 'bold' and 'italics' Server Time
3 Nov 2024 03:00:12 EST (-0500)
  Wanted: dealing with font style 'bold' and 'italics' (Message 1 to 10 of 17)  
Goto Latest 10 Messages Next 7 Messages >>>
From: Leef me
Subject: Wanted: dealing with font style 'bold' and 'italics'
Date: 6 Dec 2007 14:35:00
Message: <web.47584d4d1e565df12a7b15450@news.povray.org>
Can someone suggest how to deal with font 'bold' and 'italics' ?

I have started working with fonts and haven't found an answer from the docs or
searching the newsgroups.

As always, thanks in advance.
Leef_me



I am using POV-Ray for the Microsoft Windows.
Other windows apps have the capability of scale, bold, italics, underline,
shadow.

I happen to be using the font as a pigment on a 'theater screen',
and 3d aspect of the pigment isn't an issue.

My fall-back position is to create an image using the desired font/bold and then
us that as the pigment. But I'd rather do it in POVRAY alone.


Here's my tweaked version from:
   http://tag.povray.org/povQandT/languageQandT.html#cylindricalrepeat



//start

//===========================================================================
camera { location -z*6 look_at 0 angle 35 }
light_source { <10, 20, -50>, 1 }

// create a box that extends between the 2 specified points
box {
  <-1, -1, 0>  // one corner position <X1 Y1 Z1>
  < 1,  1,  .1>  // other corner position <X2 Y2 Z2>

  pigment
  { object
    { text { ttf "crystal", "Hello", 1.1, 0 }
      // Note: Thickness must be larger than cylinder radius
      rgb 1, rgb x
    }

    translate -z/2      // prevent "artifact known as coincident surfaces"
                        // From: Samuel Benge
                        // Subject: Re: Simple 2D text on a cylinder's surface
                        // Date: 20 Oct 2007 23:55:41
                     // http://news.povray.org/471a957d%241%40news.povray.org

    scale <-.5, .5, 1>
    warp { planar }
    translate x*.6      // better handled with Text_Space or Text_Width
  }
  rotate y*145
}

plane { y, -1.001 pigment { checker rgb 1, rgb .5 } }


//=========================================================================

//end


Post a reply to this message

From: Tim Attwood
Subject: Re: Wanted: dealing with font style 'bold' and 'italics'
Date: 6 Dec 2007 18:23:42
Message: <4758847e$1@news.povray.org>
> Can someone suggest how to deal with font 'bold' and 'italics' ?

#include "transforms.inc"

// normal text
#declare Ntext = text {ttf "timrom.ttf", "Sample Text", 0.1, <0,0,0>};
object { Ntext
   Center_Trans(Ntext,x)
   scale <0.5,0.5,1>
   translate <0,0,0>
   pigment {Gray50}
}

// italic text
#declare Itext = text {ttf "timrom.ttf", "Sample Text", 0.1, <0,0,0>};
object { Itext
   Center_Trans(Itext,x)
   scale <0.5,0.5,1>
   Shear_Trans(x, y+0.25*x, z)
   translate <0,-0.5,0>
   pigment {Gray50}
}

// bold text
#declare Btext = text {ttf "timrom.ttf", "Sample Text", 0.1, <-0.1,0,0>};
object { Btext
   Center_Trans(Btext,x)
   #local Nwidth = max_extent(Ntext).x - min_extent(Ntext).x;
   #local Bwidth = max_extent(Btext).x - min_extent(Btext).x;
   scale <Nwidth/Bwidth,1,1>
   scale <0.5,0.5,1>
   translate <0,0.5,0>
   pigment {Gray50}
}


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Wanted: dealing with font style 'bold' and 'italics'
Date: 6 Dec 2007 21:12:27
Message: <4758ac0b$1@news.povray.org>
Bold and italics are on different .ttf files. For Arial, I have these files:

arial.ttf //normal
arialbd.ttf //bold
ariali.ttf //italics
arialbi.ttf //bold and italics


Post a reply to this message

From: Leef me
Subject: Re: Wanted: dealing with font style 'bold' and 'italics'
Date: 7 Dec 2007 01:40:00
Message: <web.4758ea7917d569dd892adb1d0@news.povray.org>
"Tim Attwood" <tim### [at] comcastnet> wrote:
> > Can someone suggest how to deal with font 'bold' and 'italics' ?
>
> #include "transforms.inc"
>
> // normal text

Thanks again.  Leef_me


Post a reply to this message

From: Leef me
Subject: Re: Wanted: dealing with font style 'bold' and 'italics'
Date: 7 Dec 2007 01:45:01
Message: <web.4758eb9317d569dd892adb1d0@news.povray.org>
Nicolas Alvarez <nic### [at] gmailisthebestcom> wrote:
> Bold and italics are on different .ttf files. For Arial, I have these files:
>
> arial.ttf //normal
> arialbd.ttf //bold
> ariali.ttf //italics
> arialbi.ttf //bold and italics

Thanks Nicolas,

I tried to give all the details, I missed reporting that.

I understand that there are some fonts with separate files like these.
The particular font I wanted to use, doesn't happen to do it this way.

Leef_me


Post a reply to this message

From: pan
Subject: Re: Wanted: dealing with font style 'bold' and 'italics'
Date: 7 Dec 2007 11:08:27
Message: <47596ffb@news.povray.org>
"Leef_me" <nomail@nomail> wrote in message 
news:web.4758eb9317d569dd892adb1d0@news.povray.org...
> Nicolas Alvarez <nic### [at] gmailisthebestcom> wrote:
>> Bold and italics are on different .ttf files. For Arial, I have 
>> these files:
>>
>> arial.ttf //normal
>> arialbd.ttf //bold
>> ariali.ttf //italics
>> arialbi.ttf //bold and italics
>
> Thanks Nicolas,
>
> I tried to give all the details, I missed reporting that.
>
> I understand that there are some fonts with separate files like 
> these.
> The particular font I wanted to use, doesn't happen to do it this 
> way.
>
> Leef_me
>
>
What's the font?
Some of us have collections of typefaces ...


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Wanted: dealing with font style 'bold' and 'italics'
Date: 7 Dec 2007 12:36:40
Message: <475984a8$1@news.povray.org>

> Nicolas Alvarez <nic### [at] gmailisthebestcom> wrote:
>> Bold and italics are on different .ttf files. For Arial, I have these files:
>>
>> arial.ttf //normal
>> arialbd.ttf //bold
>> ariali.ttf //italics
>> arialbi.ttf //bold and italics
> 
> Thanks Nicolas,
> 
> I tried to give all the details, I missed reporting that.
> 
> I understand that there are some fonts with separate files like these.
> The particular font I wanted to use, doesn't happen to do it this way.
> 

Then the particular font you want to use has no bold or italics, simple. 
Maybe some word processors *fake* it in a similar way to what Tim 
Attwood said; but POV-Ray definitely doesn't have that built-in.


Post a reply to this message

From: Leef me
Subject: Re: Wanted: dealing with font style 'bold' and 'italics'
Date: 7 Dec 2007 16:10:00
Message: <web.4759b63117d569dd2a7b15450@news.povray.org>
"pan" <pan### [at] syixcom> wrote:
> "Leef_me" <nomail@nomail> wrote in message

> >
> > I understand that there are some fonts with separate files like
> > these.
> > The particular font I wanted to use, doesn't happen to do it this
> > way.
> >
> > Leef_me
> >
> >
> What's the font?
> Some of us have collections of typefaces ...

It has Curlz in the name, but it's a uSoft font packaged with some uSoft
products. Based on that thought, it's surely copyright and trading is likely a
no-no. I appreciate the thought, but Tim Attwood's code will suffice or I'll
make do with 'normal' or using a generated picture.

Leef_me


Post a reply to this message

From: Alain
Subject: Re: Wanted: dealing with font style 'bold' and 'italics'
Date: 7 Dec 2007 16:22:03
Message: <4759b97b$1@news.povray.org>
Leef_me nous apporta ses lumieres en ce 2007/12/07 01:43:
> Nicolas Alvarez <nic### [at] gmailisthebestcom> wrote:
>> Bold and italics are on different .ttf files. For Arial, I have these files:
>>
>> arial.ttf //normal
>> arialbd.ttf //bold
>> ariali.ttf //italics
>> arialbi.ttf //bold and italics
> 
> Thanks Nicolas,
> 
> I tried to give all the details, I missed reporting that.
> 
> I understand that there are some fonts with separate files like these.
> The particular font I wanted to use, doesn't happen to do it this way.
> 
> Leef_me
> 
> 
> 
> 
The shear matrix is the way for italic. It's similar to the way used by word 
processors and others to display italic when there is no italic version available.
Bold is harder to do. The characters remain about the same size, but the lines 
are thicker. A way would be to scale up horizontaly and reduce the spacing 
between the characters. It will be more like "whide condenced"

-- 
Alain
-------------------------------------------------
You *know* you've been raytracing far too long when you look at a heap of dirt 
and go "wow, that looks really realistic..."


Post a reply to this message

From: John VanSickle
Subject: Re: Wanted: dealing with font style 'bold' and 'italics'
Date: 7 Dec 2007 18:25:08
Message: <4759d654$1@news.povray.org>
Leef_me wrote:
> Can someone suggest how to deal with font 'bold' and 'italics' ?
> 
> I have started working with fonts and haven't found an answer from the docs or
> searching the newsgroups.

Can't help you with bold, as that involves changing the basic shape of 
the text.

Doing italic text object in POV-Ray is easy:

text { ttf "arial.ttf","Some text",.1,0
   matrix <1,0,0, .1,1,0, 0,0,1, 0,0,0>
}

The matrix line italicizes the font.  The .1 setting slopes the text 
over to a 10% grade.  You can go to .2 if you want very obvious italics, 
but that's enough.

There is no way of telling POV-Ray that you want to apply whatever text 
style you're used to using from your word processor; you have to 
understand what actually happens to the shapes of the letters, and then 
apply that change by altering the model accordingly.

Regards,
John


Post a reply to this message

Goto Latest 10 Messages Next 7 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.