page-sizer.cpp revision bc5ab6c60f7d73fd883b4208ea63119cd2fabfd6
1N/A * Paper-size widget and helper functions 1N/A * bulia byak <buliabyak@users.sf.net> 1N/A * Lauris Kaplinski <lauris@kaplinski.com> 1N/A * Jon Phillips <jon@rejon.org> 1N/A * Ralf Stephan <ralf@ark.in-berlin.de> (Gtkmm) 1N/A * Copyright (C) 2000 - 2005 Authors 1N/A * Released under GNU GPL. Read the file 'COPYING' for more information 1N/A * The ISO page sizes in the table below differ from ghostscript's idea of page sizes (by 1N/A * less than 1pt). Being off by <1pt should be OK for most purposes, but may cause fuzziness 1N/A * (antialiasing) problems when printing to 72dpi or 144dpi printers or bitmap files due to 1N/A * postscript's different coordinate system (y=0 meaning bottom of page in postscript and top 1N/A * of page in SVG). I haven't looked into whether this does in fact cause fuzziness, I merely 1N/A * will also affect whether fuzziness occurs. 1N/A * The remainder of this comment discusses the origin of the numbers used for ISO page sizes in 1N/A * this table and in ghostscript. 1N/A * The versions here, in mm, are the official sizes according to 1N/A * at 2005-01-25. (The ISO entries in the below table 1N/A * were produced mechanically from the table on that page.) 1N/A * (The rule seems to be that A0, B0, ..., D0. sizes are rounded to the nearest number of mm 1N/A * from the "theoretical size" (i.e. 1000 * sqrt(2) or pow(2.0, .25) or the like), whereas 1N/A * going from e.g. A0 to A1 always take the floor of halving -- which by chance coincides 1N/A * exactly with flooring the "theoretical size" for n != 0 instead of the rounding to nearest 1N/A * Ghostscript paper sizes are given in gs_statd.ps according to gs(1). gs_statd.ps always 1N/A * uses an integer number of pt: sometimes gs_statd.ps rounds to nearest (e.g. a1), sometimes 1N/A * floors (e.g. a10), sometimes ceils (e.g. a8). 1N/A * I'm not sure how ghostscript's gs_statd.ps was calculated: it isn't just rounding the 1N/A * "theoretical size" of each page to pt (see a0), nor is it rounding the a0 size times an 1N/A * appropriate power of two (see a1). Possibly it was prepared manually, with a human applying 1N/A * inconsistent rounding rules when converting from mm to pt. 1N/A * Should we include the JIS B series (used in Japan) 1N/A * (JIS B0 is sometimes called JB0, and similarly for JB1 etc)? 1N/A * Should we exclude B7--B10 and A7--10 to make the list smaller ? 1N/A * Should we include any of the ISO C, D and E series (see below) ? 1N/A#
if 0
/* Whether to include or exclude these depends on how big we mind our page size menu 1N/A becoming. C series is used for envelopes; don't know what D and E series are used for. */ 1N/A {
"US #10 Envelope",
4.125,
9.5,
SP_UNIT_IN },
// TODO: Select landscape by default. 1N/A {
"DL Envelope",
110,
220,
SP_UNIT_MM },
// TODO: Select landscape by default. 1N/A means different sizes to different people: different people may expect the width to be 1N/A either 8, 8.25 or 8.5 inches, and the height to be either 13 or 13.5 inches, even 1N/A restricting our interpretation to foolscap folio. If you wish to introduce a folio-like 1N/A page size to the list, then please consider using a name more specific than just `Folio' or 1N/A `Foolscap Folio'. */ 1N/A {
"Banner 468x60",
60,
468,
SP_UNIT_PX },
// TODO: Select landscape by default. 1N/A//=================================================== 1N/A//--------------------------------------------------- 1N/A /* Custom paper frame */ 1N/A _(
"Resize the page to fit the current selection, or the entire drawing if there is no selection")));
1N/A // prevent fit_canv from expanding 1N/A * Set document dimensions (if not called by Doc prop's update()) and 1N/A * set the PageSizer's widgets and text entries accordingly. This is 1N/A * somewhat slow, is there something done too often invisibly? 1N/A * \param w, h given in px 1N/A * Returns an index into inkscape_papers of a paper of the specified 1N/A * size (specified in px), or -1 if there's no such paper. 1N/A}
// namespace Widget 1N/A}
// namespace Inkscape 1N/A c-file-style:"stroustrup" 1N/A c-file-offsets:((innamespace . 0)(inline-open . 0)) 1N/A indent-tabs-mode:nil 1N/A// vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :