You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Tretonio Tretis <tr...@gmail.com> on 2017/08/07 19:01:47 UTC

Glyph in javaFX

I'm rendering in JavaFX,
Is it possible to get the glyph to paint in javaFX?

Javafx.scene.canvas.Canvas canvas = new javafx.scene.canvas.Canvas ();

GraphicsContext2 gc = canvas.getGraphicsContext2D ();

Thank's

Re: Glyph in javaFX

Posted by Tretonio Tretis <tr...@gmail.com>.
Tilman Hausherr, I will see the code carefully. Thank you for your generous
attention and for sharing your knowledge.

2017-08-09 15:56 GMT-03:00 Tilman Hausherr <TH...@t-online.de>:

> Am 09.08.2017 um 20:28 schrieb Tretonio Tretis:
>
>> Thanks
>> Tilman Hausherr and Steve Hannah, but i
>>
>> I only have to get the glyph of the font pdf,  example glyph that is in
>> Japanese into pdf file. no only name on unicode, but graph representation
>> this glyph character
>>
>
> PageDrawer.showFontGlyph shows how to get the path.  Alternatively have a
> look at the DrawPrintTextLocations.java example, this also gets the paths
> to get their size. (search for the word "cyan").
>
> Tilman
>
>
>
>>
>> 2017-08-09 15:14 GMT-03:00 Steve Hannah <st...@weblite.ca>:
>>
>> If you just want to render fonts on a JavaFX canvas, you'll need to create
>>> your own renderer.  I'm not sure how much help this will be to you, but I
>>> ported FontBox to work on Codename One.  The process for porting it to
>>> JavaFX canvas would be similar.  My project is here:
>>>
>>> https://github.com/shannah/CN1FontBox
>>>
>>> By looking at the commits, and comparing to the mainline FontBox sources
>>> you can probably piece together what would need to be done.
>>>
>>> Steve
>>>
>>> On Wed, Aug 9, 2017 at 11:04 AM, Tretonio Tretis <tr...@gmail.com>
>>> wrote:
>>>
>>> Correct, but i  need to get this glyph in the specified font and put it
>>>> inside my renderer in javaFX
>>>>
>>>> 2017-08-09 13:06 GMT-03:00 Tilman Hausherr <TH...@t-online.de>:
>>>>
>>>> Am 09.08.2017 um 02:31 schrieb Tretonio Tretis:
>>>>>
>>>>> My intention is renderer complete page into javaFX, with Text my
>>>>>>
>>>>> renderer
>>>>
>>>>> this correct, but in glyph no.
>>>>>>
>>>>>> I still don't understand you, specifically "with Text my renderer this
>>>>> correct, but in glyph no". I think we have a language problem here....
>>>>>
>>>>> A glyph is the visual representation of a character, and many
>>>>>
>>>> characters
>>>
>>>> make a text. So for one character (like "a") there can be many glyphs,
>>>>> depending on what font you're using.
>>>>>
>>>>> PDFBox doesn't have any support for JavaFX. Either you render into a
>>>>> BufferedImage, or you'd have to create your own PDFRenderer and
>>>>>
>>>> PageDrawer
>>>>
>>>>> by copying + modifying the source code, and then you can draw into a
>>>>>
>>>> JavaFX
>>>>
>>>>> graphics context.
>>>>>
>>>>> Tilman
>>>>>
>>>>>
>>>>>
>>>>> 2017-08-08 13:40 GMT-03:00 Tilman Hausherr <TH...@t-online.de>:
>>>>>>
>>>>>> Am 07.08.2017 um 21:01 schrieb Tretonio Tretis:
>>>>>>
>>>>>>> I'm rendering in JavaFX,
>>>>>>>
>>>>>>>> Is it possible to get the glyph to paint in javaFX?
>>>>>>>>
>>>>>>>> Javafx.scene.canvas.Canvas canvas = new javafx.scene.canvas.Canvas
>>>>>>>>
>>>>>>> ();
>>>
>>>> GraphicsContext2 gc = canvas.getGraphicsContext2D ();
>>>>>>>>
>>>>>>>> What is "the glyph"? Which one? Do you want to render whole PDF
>>>>>>>>
>>>>>>> pages,
>>>
>>>> or
>>>>>>> glyphs only, i.e. create your own renderer?
>>>>>>>
>>>>>>> Tilman
>>>>>>>
>>>>>>> ------------------------------------------------------------
>>>>>>>
>>>>>> ---------
>>>
>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------
>>>>> ---------
>>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>>
>>>>>
>>>>>
>>>
>>> --
>>> Steve Hannah
>>> Web Lite Solutions Corp.
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>

Re: Glyph in javaFX

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 09.08.2017 um 20:28 schrieb Tretonio Tretis:
> Thanks
> Tilman Hausherr and Steve Hannah, but i
>
> I only have to get the glyph of the font pdf,  example glyph that is in
> Japanese into pdf file. no only name on unicode, but graph representation
> this glyph character

PageDrawer.showFontGlyph shows how to get the path.  Alternatively have 
a look at the DrawPrintTextLocations.java example, this also gets the 
paths to get their size. (search for the word "cyan").

Tilman

>
>
> 2017-08-09 15:14 GMT-03:00 Steve Hannah <st...@weblite.ca>:
>
>> If you just want to render fonts on a JavaFX canvas, you'll need to create
>> your own renderer.  I'm not sure how much help this will be to you, but I
>> ported FontBox to work on Codename One.  The process for porting it to
>> JavaFX canvas would be similar.  My project is here:
>>
>> https://github.com/shannah/CN1FontBox
>>
>> By looking at the commits, and comparing to the mainline FontBox sources
>> you can probably piece together what would need to be done.
>>
>> Steve
>>
>> On Wed, Aug 9, 2017 at 11:04 AM, Tretonio Tretis <tr...@gmail.com>
>> wrote:
>>
>>> Correct, but i  need to get this glyph in the specified font and put it
>>> inside my renderer in javaFX
>>>
>>> 2017-08-09 13:06 GMT-03:00 Tilman Hausherr <TH...@t-online.de>:
>>>
>>>> Am 09.08.2017 um 02:31 schrieb Tretonio Tretis:
>>>>
>>>>> My intention is renderer complete page into javaFX, with Text my
>>> renderer
>>>>> this correct, but in glyph no.
>>>>>
>>>> I still don't understand you, specifically "with Text my renderer this
>>>> correct, but in glyph no". I think we have a language problem here....
>>>>
>>>> A glyph is the visual representation of a character, and many
>> characters
>>>> make a text. So for one character (like "a") there can be many glyphs,
>>>> depending on what font you're using.
>>>>
>>>> PDFBox doesn't have any support for JavaFX. Either you render into a
>>>> BufferedImage, or you'd have to create your own PDFRenderer and
>>> PageDrawer
>>>> by copying + modifying the source code, and then you can draw into a
>>> JavaFX
>>>> graphics context.
>>>>
>>>> Tilman
>>>>
>>>>
>>>>
>>>>> 2017-08-08 13:40 GMT-03:00 Tilman Hausherr <TH...@t-online.de>:
>>>>>
>>>>> Am 07.08.2017 um 21:01 schrieb Tretonio Tretis:
>>>>>> I'm rendering in JavaFX,
>>>>>>> Is it possible to get the glyph to paint in javaFX?
>>>>>>>
>>>>>>> Javafx.scene.canvas.Canvas canvas = new javafx.scene.canvas.Canvas
>> ();
>>>>>>> GraphicsContext2 gc = canvas.getGraphicsContext2D ();
>>>>>>>
>>>>>>> What is "the glyph"? Which one? Do you want to render whole PDF
>> pages,
>>>>>> or
>>>>>> glyphs only, i.e. create your own renderer?
>>>>>>
>>>>>> Tilman
>>>>>>
>>>>>> ------------------------------------------------------------
>> ---------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>
>>>>
>>
>>
>> --
>> Steve Hannah
>> Web Lite Solutions Corp.
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Glyph in javaFX

Posted by Tretonio Tretis <tr...@gmail.com>.
Thanks
Tilman Hausherr and Steve Hannah, but i

I only have to get the glyph of the font pdf,  example glyph that is in
Japanese into pdf file. no only name on unicode, but graph representation
this glyph character


2017-08-09 15:14 GMT-03:00 Steve Hannah <st...@weblite.ca>:

> If you just want to render fonts on a JavaFX canvas, you'll need to create
> your own renderer.  I'm not sure how much help this will be to you, but I
> ported FontBox to work on Codename One.  The process for porting it to
> JavaFX canvas would be similar.  My project is here:
>
> https://github.com/shannah/CN1FontBox
>
> By looking at the commits, and comparing to the mainline FontBox sources
> you can probably piece together what would need to be done.
>
> Steve
>
> On Wed, Aug 9, 2017 at 11:04 AM, Tretonio Tretis <tr...@gmail.com>
> wrote:
>
> > Correct, but i  need to get this glyph in the specified font and put it
> > inside my renderer in javaFX
> >
> > 2017-08-09 13:06 GMT-03:00 Tilman Hausherr <TH...@t-online.de>:
> >
> > > Am 09.08.2017 um 02:31 schrieb Tretonio Tretis:
> > >
> > >> My intention is renderer complete page into javaFX, with Text my
> > renderer
> > >> this correct, but in glyph no.
> > >>
> > >
> > > I still don't understand you, specifically "with Text my renderer this
> > > correct, but in glyph no". I think we have a language problem here....
> > >
> > > A glyph is the visual representation of a character, and many
> characters
> > > make a text. So for one character (like "a") there can be many glyphs,
> > > depending on what font you're using.
> > >
> > > PDFBox doesn't have any support for JavaFX. Either you render into a
> > > BufferedImage, or you'd have to create your own PDFRenderer and
> > PageDrawer
> > > by copying + modifying the source code, and then you can draw into a
> > JavaFX
> > > graphics context.
> > >
> > > Tilman
> > >
> > >
> > >
> > >> 2017-08-08 13:40 GMT-03:00 Tilman Hausherr <TH...@t-online.de>:
> > >>
> > >> Am 07.08.2017 um 21:01 schrieb Tretonio Tretis:
> > >>>
> > >>> I'm rendering in JavaFX,
> > >>>> Is it possible to get the glyph to paint in javaFX?
> > >>>>
> > >>>> Javafx.scene.canvas.Canvas canvas = new javafx.scene.canvas.Canvas
> ();
> > >>>>
> > >>>> GraphicsContext2 gc = canvas.getGraphicsContext2D ();
> > >>>>
> > >>>> What is "the glyph"? Which one? Do you want to render whole PDF
> pages,
> > >>> or
> > >>> glyphs only, i.e. create your own renderer?
> > >>>
> > >>> Tilman
> > >>>
> > >>> ------------------------------------------------------------
> ---------
> > >>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> > >>> For additional commands, e-mail: users-help@pdfbox.apache.org
> > >>>
> > >>>
> > >>>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> > > For additional commands, e-mail: users-help@pdfbox.apache.org
> > >
> > >
> >
>
>
>
> --
> Steve Hannah
> Web Lite Solutions Corp.
>

Re: Glyph in javaFX

Posted by Steve Hannah <st...@weblite.ca>.
If you just want to render fonts on a JavaFX canvas, you'll need to create
your own renderer.  I'm not sure how much help this will be to you, but I
ported FontBox to work on Codename One.  The process for porting it to
JavaFX canvas would be similar.  My project is here:

https://github.com/shannah/CN1FontBox

By looking at the commits, and comparing to the mainline FontBox sources
you can probably piece together what would need to be done.

Steve

On Wed, Aug 9, 2017 at 11:04 AM, Tretonio Tretis <tr...@gmail.com> wrote:

> Correct, but i  need to get this glyph in the specified font and put it
> inside my renderer in javaFX
>
> 2017-08-09 13:06 GMT-03:00 Tilman Hausherr <TH...@t-online.de>:
>
> > Am 09.08.2017 um 02:31 schrieb Tretonio Tretis:
> >
> >> My intention is renderer complete page into javaFX, with Text my
> renderer
> >> this correct, but in glyph no.
> >>
> >
> > I still don't understand you, specifically "with Text my renderer this
> > correct, but in glyph no". I think we have a language problem here....
> >
> > A glyph is the visual representation of a character, and many characters
> > make a text. So for one character (like "a") there can be many glyphs,
> > depending on what font you're using.
> >
> > PDFBox doesn't have any support for JavaFX. Either you render into a
> > BufferedImage, or you'd have to create your own PDFRenderer and
> PageDrawer
> > by copying + modifying the source code, and then you can draw into a
> JavaFX
> > graphics context.
> >
> > Tilman
> >
> >
> >
> >> 2017-08-08 13:40 GMT-03:00 Tilman Hausherr <TH...@t-online.de>:
> >>
> >> Am 07.08.2017 um 21:01 schrieb Tretonio Tretis:
> >>>
> >>> I'm rendering in JavaFX,
> >>>> Is it possible to get the glyph to paint in javaFX?
> >>>>
> >>>> Javafx.scene.canvas.Canvas canvas = new javafx.scene.canvas.Canvas ();
> >>>>
> >>>> GraphicsContext2 gc = canvas.getGraphicsContext2D ();
> >>>>
> >>>> What is "the glyph"? Which one? Do you want to render whole PDF pages,
> >>> or
> >>> glyphs only, i.e. create your own renderer?
> >>>
> >>> Tilman
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> >>> For additional commands, e-mail: users-help@pdfbox.apache.org
> >>>
> >>>
> >>>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> > For additional commands, e-mail: users-help@pdfbox.apache.org
> >
> >
>



-- 
Steve Hannah
Web Lite Solutions Corp.

Re: Glyph in javaFX

Posted by Tilman Hausherr <TH...@t-online.de>.
Ok, I think I get what you're trying to tell: how to draw a GeneralPath 
to JavaFX.

GraphicsContext has commands to draw curves... use 
GeneralPath.getPathIterator()
https://docs.oracle.com/javase/7/docs/api/java/awt/geom/Path2D.Float.html#getPathIterator(java.awt.geom.AffineTransform)
and then use this with JavaFx commands like

|beginPath()|, |moveTo()|, |lineTo()|, |quadraticCurveTo()|, 
|bezierCurveTo()|||, |closePath()|.

Tilman

Am 09.08.2017 um 20:04 schrieb Tretonio Tretis:
> Correct, but i  need to get this glyph in the specified font and put it
> inside my renderer in javaFX
>
> 2017-08-09 13:06 GMT-03:00 Tilman Hausherr <TH...@t-online.de>:
>
>> Am 09.08.2017 um 02:31 schrieb Tretonio Tretis:
>>
>>> My intention is renderer complete page into javaFX, with Text my renderer
>>> this correct, but in glyph no.
>>>
>> I still don't understand you, specifically "with Text my renderer this
>> correct, but in glyph no". I think we have a language problem here....
>>
>> A glyph is the visual representation of a character, and many characters
>> make a text. So for one character (like "a") there can be many glyphs,
>> depending on what font you're using.
>>
>> PDFBox doesn't have any support for JavaFX. Either you render into a
>> BufferedImage, or you'd have to create your own PDFRenderer and PageDrawer
>> by copying + modifying the source code, and then you can draw into a JavaFX
>> graphics context.
>>
>> Tilman
>>
>>
>>
>>> 2017-08-08 13:40 GMT-03:00 Tilman Hausherr <TH...@t-online.de>:
>>>
>>> Am 07.08.2017 um 21:01 schrieb Tretonio Tretis:
>>>> I'm rendering in JavaFX,
>>>>> Is it possible to get the glyph to paint in javaFX?
>>>>>
>>>>> Javafx.scene.canvas.Canvas canvas = new javafx.scene.canvas.Canvas ();
>>>>>
>>>>> GraphicsContext2 gc = canvas.getGraphicsContext2D ();
>>>>>
>>>>> What is "the glyph"? Which one? Do you want to render whole PDF pages,
>>>> or
>>>> glyphs only, i.e. create your own renderer?
>>>>
>>>> Tilman
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>


Re: Glyph in javaFX

Posted by Tretonio Tretis <tr...@gmail.com>.
Correct, but i  need to get this glyph in the specified font and put it
inside my renderer in javaFX

2017-08-09 13:06 GMT-03:00 Tilman Hausherr <TH...@t-online.de>:

> Am 09.08.2017 um 02:31 schrieb Tretonio Tretis:
>
>> My intention is renderer complete page into javaFX, with Text my renderer
>> this correct, but in glyph no.
>>
>
> I still don't understand you, specifically "with Text my renderer this
> correct, but in glyph no". I think we have a language problem here....
>
> A glyph is the visual representation of a character, and many characters
> make a text. So for one character (like "a") there can be many glyphs,
> depending on what font you're using.
>
> PDFBox doesn't have any support for JavaFX. Either you render into a
> BufferedImage, or you'd have to create your own PDFRenderer and PageDrawer
> by copying + modifying the source code, and then you can draw into a JavaFX
> graphics context.
>
> Tilman
>
>
>
>> 2017-08-08 13:40 GMT-03:00 Tilman Hausherr <TH...@t-online.de>:
>>
>> Am 07.08.2017 um 21:01 schrieb Tretonio Tretis:
>>>
>>> I'm rendering in JavaFX,
>>>> Is it possible to get the glyph to paint in javaFX?
>>>>
>>>> Javafx.scene.canvas.Canvas canvas = new javafx.scene.canvas.Canvas ();
>>>>
>>>> GraphicsContext2 gc = canvas.getGraphicsContext2D ();
>>>>
>>>> What is "the glyph"? Which one? Do you want to render whole PDF pages,
>>> or
>>> glyphs only, i.e. create your own renderer?
>>>
>>> Tilman
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>

Re: Glyph in javaFX

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 09.08.2017 um 02:31 schrieb Tretonio Tretis:
> My intention is renderer complete page into javaFX, with Text my renderer
> this correct, but in glyph no.

I still don't understand you, specifically "with Text my renderer this 
correct, but in glyph no". I think we have a language problem here....

A glyph is the visual representation of a character, and many characters 
make a text. So for one character (like "a") there can be many glyphs, 
depending on what font you're using.

PDFBox doesn't have any support for JavaFX. Either you render into a 
BufferedImage, or you'd have to create your own PDFRenderer and 
PageDrawer by copying + modifying the source code, and then you can draw 
into a JavaFX graphics context.

Tilman

>
> 2017-08-08 13:40 GMT-03:00 Tilman Hausherr <TH...@t-online.de>:
>
>> Am 07.08.2017 um 21:01 schrieb Tretonio Tretis:
>>
>>> I'm rendering in JavaFX,
>>> Is it possible to get the glyph to paint in javaFX?
>>>
>>> Javafx.scene.canvas.Canvas canvas = new javafx.scene.canvas.Canvas ();
>>>
>>> GraphicsContext2 gc = canvas.getGraphicsContext2D ();
>>>
>> What is "the glyph"? Which one? Do you want to render whole PDF pages, or
>> glyphs only, i.e. create your own renderer?
>>
>> Tilman
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Glyph in javaFX

Posted by Tretonio Tretis <tr...@gmail.com>.
My intention is renderer complete page into javaFX, with Text my renderer
this correct, but in glyph no.

2017-08-08 13:40 GMT-03:00 Tilman Hausherr <TH...@t-online.de>:

> Am 07.08.2017 um 21:01 schrieb Tretonio Tretis:
>
>> I'm rendering in JavaFX,
>> Is it possible to get the glyph to paint in javaFX?
>>
>> Javafx.scene.canvas.Canvas canvas = new javafx.scene.canvas.Canvas ();
>>
>> GraphicsContext2 gc = canvas.getGraphicsContext2D ();
>>
>
> What is "the glyph"? Which one? Do you want to render whole PDF pages, or
> glyphs only, i.e. create your own renderer?
>
> Tilman
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>

Re: Glyph in javaFX

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 07.08.2017 um 21:01 schrieb Tretonio Tretis:
> I'm rendering in JavaFX,
> Is it possible to get the glyph to paint in javaFX?
>
> Javafx.scene.canvas.Canvas canvas = new javafx.scene.canvas.Canvas ();
>
> GraphicsContext2 gc = canvas.getGraphicsContext2D ();

What is "the glyph"? Which one? Do you want to render whole PDF pages, 
or glyphs only, i.e. create your own renderer?

Tilman

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org