[Bug 64605] New: XWPFRun font size support float

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 64605] New: XWPFRun font size support float

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64605

            Bug ID: 64605
           Summary: XWPFRun font size support float
           Product: POI
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XWPF
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

XWPFRun interface define:
public class XWPFRun implements ISDTContents, IRunElement, CharacterRun {
    ......
    public void setFontSize(int size) {
    }
}


my source code:

float fontSize = 10.5;
XWPFRun run = para.createRun();
run.setFontSize((int) fontSize);

i find other library support float, and poi truncate the float value to
int(10.5 to 10), the text seems ugly.

can fix the problem?
thanks.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64605] XWPFRun font size support float

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64605

--- Comment #1 from PJ Fanning <[hidden email]> ---
The number that is added the XML in the xlsx file is twice the value provided
in our APIs. This XML number has to be an integer, so the POI API should really
only accept whole numbers and numbers where the decimal part is .5.

Feel free the provide a patch but beware there is also a `getFontSize` -- we
can't change its return type, so you'll need to add a `getFontSizeAsFloat` as
an alternative method.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64605] XWPFRun font size support float

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64605

--- Comment #2 from PJ Fanning <[hidden email]> ---
I added
https://github.com/apache/poi/commit/d928ac58a82b243138282ea69ee53b318b8a052c

Could do with more tests though

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64605] XWPFRun font size support float

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64605

--- Comment #3 from PJ Fanning <[hidden email]> ---
changed to double to more closely match some other APIs (eg XDDF APIs) -
https://github.com/apache/poi/commit/4a173780dd793aed02c54ba0a9c816ce1b1f8991

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64605] XWPFRun font size support float

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64605

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from [hidden email] ---
hi, PJ Fanning ,
thanks for your job. please add the feature to next version.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]