You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2016/03/05 21:33:12 UTC

[Bug 59127] New: Ability to replace the default font

https://bz.apache.org/bugzilla/show_bug.cgi?id=59127

            Bug ID: 59127
           Summary: Ability to replace the default font
           Product: POI
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: dtn-asfbugs@corefiling.co.uk

The default font is important because the cell sizes are derived from it.

POI adds a default font because Excel requires there to be one; we used to swap
it for our own like this:

workbook,getStylseSource().getFonts().clear()
// create a font as normal, it becomes the default by virtue of being first

Unfortunately that no longer works as Javen (quite reasonably) made the
returned list an unmodifiable one in r1721857.

So I propose we add some proper API to replace the default font, e.g. add to
StylesTable:

void replaceDefaultFont(XSSFFont font)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 59127] Ability to replace the default font

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59127

--- Comment #1 from Javen O'Neal <on...@apache.org> ---
Would
XSSFFont defaultFont = StylesTable.getFonts().get(0);
// mutate defaultFont as needed
work?

StylesTable.getDefaultFont() would be convenient here, returning a reference to
the current default font in the styles table

replaceDefaultFont(XSSFFont font) would be tricky because XSSFFonts have an
immutable index (into the font table?). All the mutable fields could be copied
from the passed-in font to the default font.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 59127] Ability to replace the default font

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59127

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 59127] Ability to replace the default font

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59127

David North <dt...@corefiling.co.uk> changed:

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

--- Comment #2 from David North <dt...@corefiling.co.uk> ---
Thanks Javen. That approach works for us, so no POI change necessary after all.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org