*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <config.h>
CharMetricInfo *cm;
FILE *in;
- in = fopen(filename, "r");
+ in = fopen(filename, "rb");
if(in == NULL)
return -1;
status = afm_parse_file(in, &fi, P_GM);
fclose(in);
if(status != ok) {
- error(_("%s: Error reading AFM data\n"), filename);
+ mdvi_error(_("%s: Error reading AFM data\n"), filename);
return -1;
}
Int32 *depths;
Uint32 checksum;
- in = fopen(filename, "r");
+ in = fopen(filename, "rb");
if(in == NULL)
return -1;
tfm = NULL;
/* allocate a word-aligned buffer to hold the file */
size = 4 * ROUND(st.st_size, 4);
if(size != st.st_size)
- warning(_("Warning: TFM file `%s' has suspicious size\n"),
- filename);
+ mdvi_warning(_("Warning: TFM file `%s' has suspicious size\n"),
+ filename);
tfm = (Uchar *)mdvi_malloc(size);
if(fread(tfm, st.st_size, 1, in) != 1)
goto error;
/* get the coding scheme */
i = n = msget1(ptr);
if(n < 0 || n > 39) {
- warning(_("%s: font coding scheme truncated to 40 bytes\n"),
- filename);
+ mdvi_warning(_("%s: font coding scheme truncated to 40 bytes\n"),
+ filename);
n = 39;
}
memcpy(info->coding, ptr, n);
return 0;
bad_tfm:
- error(_("%s: File corrupted, or not a TFM file\n"), filename);
+ mdvi_error(_("%s: File corrupted, or not a TFM file\n"), filename);
error:
if(tfm) mdvi_free(tfm);
if(in) fclose(in);
int olevel;
int nwords;
- in = fopen(filename, "r");
+ in = fopen(filename, "rb");
if(in == NULL)
return -1;
/* get the coding scheme */
i = n = fsget1(in);
if(n < 0 || n > 39) {
- warning(_("%s: font coding scheme truncated to 40 bytes\n"),
- filename);
+ mdvi_warning(_("%s: font coding scheme truncated to 40 bytes\n"),
+ filename);
n = 39;
}
fread(info->coding, 39, 1, in);
return 0;
bad_tfm:
- error(_("%s: File corrupted, or not a TFM file\n"), filename);
+ mdvi_error(_("%s: File corrupted, or not a TFM file\n"), filename);
fclose(in);
return -1;
}