tetexbin
3.0

00001 /* magstep.h: declaration for magstep fixing. 00002 00003 Copyright (C) 1994 Karl Berry. 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place  Suite 330, Boston, MA 021111307, USA. */ 00018 00019 #ifndef KPATHSEA_MAGSTEP_H 00020 #define KPATHSEA_MAGSTEP_H 00021 00022 #include <kpathsea/cproto.h> 00023 #include <kpathsea/types.h> 00024 00025 /* If DPI is close enough to some magstep of BDPI, return the true dpi 00026 value, and the magstep found (or zero) in M_RET (if 00027 nonnull). ``Close enough'' means within one pixel. 00028 00029 M_RET is slightly encoded: the least significant bit is on for a 00030 halfmagstep, off otherwise. Thus, a returned M_RET of 1 means 00031 \magstephalf, i.e., sqrt(1.2), i.e., 1.09544. Put another way, 00032 return twice the number of magsteps. 00033 00034 In practice, this matters for magstephalf. Floatingpoint computation 00035 with the fixedpoint DVI representation leads to 328 (for BDPI == 00036 300); specifying `at 11pt' yields 330; the true \magstephalf is 329 00037 (that's what you get if you run Metafont with mag:=magstep(.5)). 00038 00039 The time to call this is after you read the font spec from the DVI 00040 file, but before you look up any files  do the usual floatingpoint 00041 computations, and then fix up the result. */ 00042 00043 extern KPSEDLL unsigned kpse_magstep_fix P3H(unsigned dpi, unsigned bdpi, int *m_ret); 00044 00045 #endif /* not KPATHSEA_MAGSTEP_H */