Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support inline format of Prawn in Text and TextBlock #5

Open
hidakatsuya opened this issue Oct 1, 2014 · 13 comments
Open

Support inline format of Prawn in Text and TextBlock #5

hidakatsuya opened this issue Oct 1, 2014 · 13 comments

Comments

@hidakatsuya
Copy link
Member

Prawn's inline formatting:
http://rubydoc.info/gems/prawn/0.12.0/Prawn/Text:text

Support formats:

  • Bold: <b>bold</b>
  • Italic: <i>italic</i>
  • Underline: <u>underline</u>
  • Strikethrough: <strikethrough>strikethrough</strikethrough>
  • Subscript, Superscript: <superscript>super</superscript>, <subscript>sub</subscript>
  • Font style - Size, CharacterSpacing: <font size="24">font style</font>
  • Text color: <color rgb="#ff0000">color</color>
  • Link: <link href="http://www.thinreports.org">thinreports.org</link>

Support table:

Format TextBlock in global TextBlock in List Text
<b> Yes Yes Yes
<i> Yes Yes Yes
<u> Yes Yes Yes
<strikethrough> Yes Yes Yes
<sub> Yes Yes Yes
<sup> Yes Yes Yes
<font> Yes Yes Yes
<color> Yes Yes Yes
<link> Yes Yes Yes

Example:

page.item(:text).value('<b>ThinReports</b> official site is <i>thinreports.org</i>')

=> ThinReports official site is thinreports.org.

@hidakatsuya hidakatsuya added the enhancement New feature or request label Oct 1, 2014
@hidakatsuya hidakatsuya self-assigned this Oct 1, 2014
@elshaka
Copy link

elshaka commented Oct 2, 2014

I ended up monkey-patching the text_box method in my rails app. It's a terrible approach but at least it got the job done for now.

Inline format works as expected except for the fact that links are not clickable when you use them inside a list for some reason.

@hidakatsuya
Copy link
Member Author

Thank you for your advice.

My implementation for this feature is almost the same as your. Also inline format is enabled by thinreports/thinreports-basic-editor#12.

@hidakatsuya hidakatsuya added this to the 0.8.0 milestone Oct 3, 2014
@hidakatsuya
Copy link
Member Author

I think that a problem that links are not clickable is probably caused by prawn's bug (or specification). So i have reported the issue to prawnpdf/prawn#801.

@hidakatsuya
Copy link
Member Author

The Inline link wont't supports.

@hidakatsuya hidakatsuya changed the title Support for inline format of Prawn in the text Support a part of inline format of Prawn in Text and TextBlock Feb 24, 2015
@hidakatsuya
Copy link
Member Author

We will support a part in this version as below:

Format TextBlock in global TextBlock in List Text
<b> Yes Yes Yes
<i> Yes Yes Yes
<u> Yes Yes Yes
<strikethrough> Yes Yes Yes
<sub> Yes Yes Yes
<sup> Yes Yes Yes
<font> Yes Yes Yes
<color> Yes Yes Yes
<link> Yes No No

@hidakatsuya
Copy link
Member Author

We have desided that we don't fix this feature in v0.8. Becase following cases don't work:

  • <font name="IPAMincho"><b>日本語</b></font>
  • <link href="http://www.example.com">link</link>

So, we will move the feature to v1.0.0 milestone.

@hidakatsuya hidakatsuya modified the milestones: 1.0.0, 0.8.0 Apr 16, 2015
maeda-m pushed a commit that referenced this issue Apr 16, 2015
@hidakatsuya
Copy link
Member Author

This feature will be implemented in 1.0.0, because prawnpdf/prawn#801 have been fixed in prawn 2.0.1.

@hidakatsuya hidakatsuya reopened this May 9, 2015
@hidakatsuya hidakatsuya changed the title Support a part of inline format of Prawn in Text and TextBlock Support inline format of Prawn in Text and TextBlock May 9, 2015
@juggy
Copy link

juggy commented Oct 15, 2015

Can this be merged back? It seems prawn issue is fixed.

@hidakatsuya
Copy link
Member Author

Can this be merged back? It seems prawn issue is fixed.

Yes, we will try to merge it in v1.0.0.

@hidakatsuya hidakatsuya added Concept and removed enhancement New feature or request labels Oct 31, 2015
@willjohnson
Copy link

@elshaka Can you provide a new link to your workaround for this?

Thanks!

@elshaka
Copy link

elshaka commented Mar 7, 2016

@willjohnson here ! It's an old monkey patch, you should check if it still does the job, I'm not using it right now.

@mukuls-brdsys
Copy link

Any eta for 1.0.0 ?

@hidakatsuya hidakatsuya removed this from the 1.0.0 milestone Oct 21, 2016
@hidakatsuya
Copy link
Member Author

@mukuls-brdsys

Any eta for 1.0.0 ?

The specific release schedule is undecided.

@hidakatsuya hidakatsuya added the help wanted Extra attention is needed label Mar 15, 2018
@hidakatsuya hidakatsuya removed their assignment May 21, 2019
@hidakatsuya hidakatsuya removed the help wanted Extra attention is needed label May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants