PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

How to create outlined (or hollow) text?
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1722
Page 1 of 1

Author:  Ankha [ Thu Jul 21, 2011 1:01 pm ]
Post subject:  How to create outlined (or hollow) text?

Hi,

I'd like to know if it is possible to create outlined text and how.
By outlined text, I mean this:

Image

(yellow body, dark blue outline).

I think this "style" exists in the pdf format.

Otherwise, how could I mimic it by making the character fatter (increasing the font size doesn't work) ?

Thanks

Author:  Ankha [ Fri Jul 22, 2011 9:21 am ]
Post subject:  Re: How to create outlined (or hollow) text?

I forgot to mention that I use pdfSharp.

Author:  Ankha [ Mon Jul 25, 2011 3:20 pm ]
Post subject:  Re: How to create outlined (or hollow) text?

No clues?
Is it possible to do it or is it something planned in a later release?

TIA

Author:  Thomas Hoevel [ Tue Jul 26, 2011 7:45 am ]
Post subject:  Re: How to create outlined (or hollow) text?

Hi!
Ankha wrote:
I think this "style" exists in the pdf format.

Can you provide a sample file with that text style?

Ankha wrote:
Otherwise, how could I mimic it by making the character fatter (increasing the font size doesn't work)?

Print the text several times at different positions.

Sample grid:
123
456
789

At positions 1, 3, 7, and 9 (or 1, 2, 3, 4, 6, 7, 8, 9) draw text in the outline color, at position 5 draw text in the inner color.

So if the normal text is to be at (100, 100) and you want an outline width of 1, draw the outline color at (99, 99), at (101, 99), at (99, 101), and at (101, 101), then draw the inner color at (100, 100).

Author:  Ankha [ Tue Jul 26, 2011 7:51 am ]
Post subject:  Re: How to create outlined (or hollow) text?

Thomas Hoevel wrote:
Hi!
Ankha wrote:
I think this "style" exists in the pdf format.

Can you provide a sample file with that text style?

Adobe Illustrator supports it, that's why I suppose there's a style of a sort. I'll check.

Thomas Hoevel wrote:
Ankha wrote:
Otherwise, how could I mimic it by making the character fatter (increasing the font size doesn't work)?

Print the text several times at different positions.

Sample grid:
123
456
789

At positions 1, 3, 7, and 9 (or 1, 2, 3, 4, 6, 7, 8, 9) draw text in the outline color, at position 5 draw text in the inner color.

So if the normal text is to be at (100, 100) and you want an outline width of 1, draw the outline color at (99, 99), at (101, 99), at (99, 101), and at (101, 101), then draw the inner color at (100, 100).

I'll try, but I fear it may not work with a 'o' for instance.

Author:  Ankha [ Tue Jul 26, 2011 12:35 pm ]
Post subject:  Re: How to create outlined (or hollow) text?

I tried your suggestion but it's not perfect.

I write the text in black in a circle around the white text.

Here's the result with 20 positions and 9 positions. The outline is "jagged". (What you see is the upper right corner of the 'g' letter).

Image

Author:  Thomas Hoevel [ Tue Jul 26, 2011 2:12 pm ]
Post subject:  Re: How to create outlined (or hollow) text?

Ankha wrote:
I tried your suggestion but it's not perfect.

Not perfect, but only visible at a high zoom level.

It seems that Illustrator converts the text to a path and then draws that path in PDF.

PDFsharp can do that, too.
See page 3 of the output file of this sample:
http://www.pdfsharp.net/wiki/Graphics-sample.ashx
(shame on me, I should know our samples)

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/