diff --git a/dviwin.cpp b/dviwin.cpp index 16e80cd01..06743b726 100644 --- a/dviwin.cpp +++ b/dviwin.cpp @@ -553,7 +553,7 @@ bool dviWindow::setFile(QString fname, QString ref, bool sourceMarker) command_pointer = end_pointer = 0; memset((char *) &currinf.data, 0, sizeof(currinf.data)); - currinf.fonttable = dviFile->tn_table; + currinf.fonttable = &(dviFile->tn_table); currinf._virtual = NULL; draw_part(65536.0*fontPixelPerDVIunit(), false); diff --git a/dviwin.h b/dviwin.h index fdb37dfcd..9337e2390 100644 --- a/dviwin.h +++ b/dviwin.h @@ -96,7 +96,7 @@ struct drawinf { TeXFontDefinition *fontp; set_char_proc set_char_p; - QIntDict fonttable; + QIntDict *fonttable; TeXFontDefinition *_virtual; }; diff --git a/dviwin_draw.cpp b/dviwin_draw.cpp index ea5e414d9..abf1b40ed 100644 --- a/dviwin_draw.cpp +++ b/dviwin_draw.cpp @@ -228,7 +228,7 @@ void dviWindow::set_vf_char(unsigned int cmd, unsigned int ch) currinf.data.y = 0; currinf.data.z = 0; - currinf.fonttable = currinf.fontp->vf_table; + currinf.fonttable = &(currinf.fontp->vf_table); currinf._virtual = currinf.fontp; Q_UINT8 *command_ptr_sav = command_pointer; Q_UINT8 *end_ptr_sav = end_pointer; @@ -284,7 +284,7 @@ void dviWindow::draw_part(double current_dimconv, bool is_vfmacro) (this->*currinf.set_char_p)(ch, ch); } else if (FNTNUM0 <= ch && ch <= (unsigned char) (FNTNUM0 + 63)) { - currinf.fontp = currinf.fonttable[ch - FNTNUM0]; + currinf.fontp = currinf.fonttable->find(ch - FNTNUM0); if (currinf.fontp == NULL) { errorMsg = i18n("The DVI code referred to font #%1, which was not previously defined.").arg(ch - FNTNUM0); return; @@ -495,7 +495,7 @@ void dviWindow::draw_part(double current_dimconv, bool is_vfmacro) case FNT1: case FNT2: case FNT3: - currinf.fontp = currinf.fonttable[readUINT(ch - FNT1 + 1)]; + currinf.fontp = currinf.fonttable->find(readUINT(ch - FNT1 + 1)); if (currinf.fontp == NULL) { errorMsg = i18n("The DVI code referred to a font which was not previously defined."); return; @@ -504,7 +504,7 @@ void dviWindow::draw_part(double current_dimconv, bool is_vfmacro) break; case FNT4: - currinf.fontp = currinf.fonttable[readINT(ch - FNT1 + 1)]; + currinf.fontp = currinf.fonttable->find(readINT(ch - FNT1 + 1)); if (currinf.fontp == NULL) { errorMsg = i18n("The DVI code referred to a font which was not previously defined."); return; @@ -612,7 +612,7 @@ void dviWindow::draw_page(void) command_pointer = end_pointer = 0; memset((char *) &currinf.data, 0, sizeof(currinf.data)); - currinf.fonttable = dviFile->tn_table; + currinf.fonttable = &(dviFile->tn_table); currinf._virtual = 0; draw_part(65536.0*fontPixelPerDVIunit(), false); if (HTML_href != 0) { diff --git a/fontpool.cpp b/fontpool.cpp index 000212561..ec9a131ff 100644 --- a/fontpool.cpp +++ b/fontpool.cpp @@ -45,7 +45,6 @@ fontPool::fontPool(void) proc = 0; makepk = true; // By default, fonts are generated - enlargeFonts = true; // By default, fonts are enlarged displayResolution_in_dpi = 100.0; // A not-too-bad-default MetafontMode = DefaultMFMode; fontList.setAutoDelete(TRUE); @@ -124,7 +123,7 @@ fontPool::~fontPool(void) } -void fontPool::setParameters( unsigned int _metafontMode, bool _makePK, bool _enlargeFonts, bool _useType1Fonts, bool _useFontHints ) +void fontPool::setParameters( unsigned int _metafontMode, bool _makePK, bool _useType1Fonts, bool _useFontHints ) { if (_metafontMode >= NumberOfMFModes) { kdError(4300) << "fontPool::setMetafontMode called with argument " << _metafontMode @@ -160,10 +159,8 @@ void fontPool::setParameters( unsigned int _metafontMode, bool _makePK, bool _en } // Check if glyphs need to be cleared - if ((_enlargeFonts != enlargeFonts) || (_useFontHints != useFontHints)) { + if (_useFontHints != useFontHints) { double displayResolution = displayResolution_in_dpi; - if (_enlargeFonts == true) - displayResolution *= 1.1; TeXFontDefinition *fontp = fontList.first(); while(fontp != 0 ) { fontp->setDisplayResolution(displayResolution * fontp->enlargement); @@ -173,7 +170,6 @@ void fontPool::setParameters( unsigned int _metafontMode, bool _makePK, bool _en MetafontMode = _metafontMode; makepk = _makePK; - enlargeFonts = _enlargeFonts; useType1Fonts = _useType1Fonts; useFontHints = _useFontHints; @@ -204,8 +200,6 @@ class TeXFontDefinition *fontPool::appendx(QString fontname, Q_UINT32 checksum, // If font doesn't exist yet, we have to generate a new font. double displayResolution = displayResolution_in_dpi; - if (enlargeFonts == true) - displayResolution *= 1.1; fontp = new TeXFontDefinition(fontname, displayResolution*enlargement, checksum, scale, this, enlargement); if (fontp == 0) { @@ -597,7 +591,7 @@ void fontPool::kpsewhich_terminated(KProcess *) config->setGroup("kdvi"); config->writeEntry( "MakePK", true ); config->sync(); - setParameters( MetafontMode, true, enlargeFonts, useType1Fonts, useFontHints ); // That will start kpsewhich again. + setParameters( MetafontMode, true, useType1Fonts, useFontHints ); // That will start kpsewhich again. return; } } else @@ -618,8 +612,6 @@ void fontPool::setDisplayResolution( double _displayResolution_in_dpi ) #endif displayResolution_in_dpi = _displayResolution_in_dpi; double displayResolution = displayResolution_in_dpi; - if (enlargeFonts == true) - displayResolution *= 1.1; TeXFontDefinition *fontp = fontList.first(); while(fontp != 0 ) { diff --git a/fontpool.h b/fontpool.h index eef99b544..a8e33185f 100644 --- a/fontpool.h +++ b/fontpool.h @@ -62,36 +62,24 @@ Q_OBJECT fontpool.cpp. Returns the mode number of the mode which was actually set ---if an invalid argument is given, this will be the DefaultMFMode as defined in fontPool.h */ - // unsigned int setMetafontMode( unsigned int ); - void setParameters( unsigned int MetaFontMode, bool makePK, bool enlargeFonts, bool useType1Fonts, bool useFontHints ); + /** Sets whether fonts will be generated by running MetaFont, or a + similar programm. If (flag == 0), fonts will not be generated, + otherwise they will. */ + + /** Determines if Adobe Type 1 (*.pfb) fonts should be used or not */ + + /** Sets the resolution of the output device and determines if font hinting should be used. */ + + void setParameters( unsigned int MetaFontMode, bool makePK, bool useType1Fonts, bool useFontHints ); /** Returns the currently set MetafontMode */ unsigned int getMetafontMode(void) {return MetafontMode;}; - /** Sets whether fonts will be generated by running MetaFont, or a - similar programm. If (flag == 0), fonts will not be generated, - otherwise they will. */ - // void setMakePK( bool flag ); - - /** Sets whether glyphs will be enlarged or not. If (flag == 0), - glyphs will not be enlarged, otherwise they will. */ - // void setEnlargeFonts( bool flag ); - /** Sets the resolution of the output device. */ void setDisplayResolution( double _displayResolution_in_dpi ); - /** Sets the resolution of the output device and determines if font hinting should be used. */ - // void setUseFontHints( bool _useFontHinting ); - - /** Determines if Adobe Type 1 (*.pfb) fonts should be used or not */ - // void setUseType1Fonts( bool _useType1Fonts ); - - /** Returns the status of enlargeFonts. If the return value is == - 0, glyphs will not be enlarged, otherwise they will. */ - bool getEnlargeFonts() {return enlargeFonts;}; - /** If return value is true, font hinting should be used if possible */ bool getUseFontHints(void) {return useFontHints;}; @@ -233,11 +221,7 @@ public slots: font if a bitmap is not available. If makepk == 0, then bitmaps are NOT generated. */ bool makepk; - - /** This flag determines whether the glyphs should be enlarged by 10% - or not. If enlargeFonts==0, then fonts are NOT enlarged. */ - bool enlargeFonts; - + /** This flag is used by PFB fonts to determine if the FREETYPE engine should use hinted fonts or not */ bool useFontHints; diff --git a/kdvi_multipage.cpp b/kdvi_multipage.cpp index 49ac96853..5d962d930 100644 --- a/kdvi_multipage.cpp +++ b/kdvi_multipage.cpp @@ -350,8 +350,6 @@ void KDVIMultiPage::preferencesChanged() config->writeEntry( "MetafontMode", mfmode = DefaultMFMode ); bool makepk = config->readBoolEntry( "MakePK", true ); - bool enlargeFonts = config->readBoolEntry( "enlarge_for_readability", true ); - bool showPS = config->readBoolEntry( "ShowPS", true ); if (showPS != window->showPS()) window->setShowPS(showPS); @@ -363,7 +361,7 @@ void KDVIMultiPage::preferencesChanged() bool useType1Fonts = config->readBoolEntry( "UseType1Fonts", true ); bool useFontHints = config->readBoolEntry( "UseFontHints", true ); - window->font_pool->setParameters(mfmode, makepk, enlargeFonts, useType1Fonts, useFontHints); + window->font_pool->setParameters(mfmode, makepk, useType1Fonts, useFontHints); window->setEditorCommand( config->readEntry( "EditorCommand", "" )); } diff --git a/optionDialogFontsWidget.cpp b/optionDialogFontsWidget.cpp index 33f0cd120..1fe038c6f 100644 --- a/optionDialogFontsWidget.cpp +++ b/optionDialogFontsWidget.cpp @@ -57,7 +57,6 @@ optionDialogFontsWidget::optionDialogFontsWidget( QWidget* parent, const char* #endif fontGenerationCheckBox->setChecked( config->readBoolEntry( "MakePK", true ) ); - fontEnlargementCheckBox->setChecked( config->readBoolEntry( "enlarge_for_readability", true ) ); } optionDialogFontsWidget::~optionDialogFontsWidget() @@ -75,7 +74,6 @@ void optionDialogFontsWidget::apply(void) #endif config->writeEntry( "MetafontMode", metafontMode->currentItem() ); config->writeEntry( "MakePK", fontGenerationCheckBox->isChecked() ); - config->writeEntry( "enlarge_for_readability", fontEnlargementCheckBox->isChecked() ); config->sync(); } diff --git a/optionDialogFontsWidget_base.ui b/optionDialogFontsWidget_base.ui index f08507686..1e8459409 100644 --- a/optionDialogFontsWidget_base.ui +++ b/optionDialogFontsWidget_base.ui @@ -9,7 +9,7 @@ 0 0 259 - 241 + 299 @@ -120,14 +120,6 @@ - - - fontEnlargementCheckBox - - - Enlarge fonts for better readability - - spacer2