Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions code/src/java/pcgen/core/Globals.java
Original file line number Diff line number Diff line change
Expand Up @@ -742,15 +742,29 @@ public static boolean selectPaper(final String paperName)
/**
* Apply the user's preferences to the initial state of the Globals.
*/
public static void initPreferences()
public static void initPreferences()
{
if (selectedPaper != -1)
{
// Already initialized
return;
}
final String papersize = PCGenSettings.getInstance().initProperty(PCGenSettings.PAPERSIZE, "A4");
selectPaper(papersize);

String defaultPaper = "A4";
String country = java.util.Locale.getDefault().getCountry();
if ("US".equalsIgnoreCase(country) || "CA".equalsIgnoreCase(country))
{
defaultPaper = "Letter";
}

String papersize = PCGenSettings.getInstance().initProperty(PCGenSettings.PAPERSIZE, defaultPaper);

// Self-healing fallback: If the saved paper size is invalid, force it to the regional default
if (!selectPaper(papersize))
{
PCGenSettings.getInstance().setProperty(PCGenSettings.PAPERSIZE, defaultPaper);
selectPaper(defaultPaper);
}
}

/**
Expand Down Expand Up @@ -1085,4 +1099,4 @@ public static LoadContext getContext()
{
return SettingsHandler.getGameAsProperty().get().getContext();
}
}
}
4 changes: 2 additions & 2 deletions outputsheets/d20/4e/pdf/fantasy_master_common_blocks.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -78,7 +78,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
4 changes: 2 additions & 2 deletions outputsheets/d20/4e/pdf/inc_pagedimensions.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -44,7 +44,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
4 changes: 2 additions & 2 deletions outputsheets/d20/5e/pdf/fantasy_master_alt_largetext.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -57,7 +57,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
4 changes: 2 additions & 2 deletions outputsheets/d20/5e/pdf/fantasy_master_common_blocks.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -78,7 +78,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -78,7 +78,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
4 changes: 2 additions & 2 deletions outputsheets/d20/5e/pdf/fantasy_master_no_header.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -78,7 +78,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
4 changes: 2 additions & 2 deletions outputsheets/d20/5e/pdf/fantasy_master_no_spells.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -77,7 +77,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
4 changes: 2 additions & 2 deletions outputsheets/d20/5e/pdf/fantasy_master_spell_list_only.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -65,7 +65,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
4 changes: 2 additions & 2 deletions outputsheets/d20/5e/pdf/inc_pagedimensions.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -44,7 +44,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -57,7 +57,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -87,7 +87,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -78,7 +78,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
4 changes: 2 additions & 2 deletions outputsheets/d20/fantasy/pdf/fantasy_master_no_header.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -78,7 +78,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -78,7 +78,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
4 changes: 2 additions & 2 deletions outputsheets/d20/fantasy/pdf/inc_pagedimensions.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -44,7 +44,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -87,7 +87,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
4 changes: 2 additions & 2 deletions outputsheets/d20/modern/pdf/csheet_modern_std.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -78,7 +78,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -57,7 +57,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -86,7 +86,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<xsl:value-of select="25.4 * 11.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="297"/>
<xsl:value-of select="25.4 * 11.0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand All @@ -78,7 +78,7 @@
<xsl:value-of select="25.4 * 8.5"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="210"/>
<xsl:value-of select="25.4 * 8.5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down
Loading
Loading