]> git.lyx.org Git - lyx.git/commitdiff
float2string #3 (lyxrc)
authorJürgen Spitzmüller <spitz@lyx.org>
Wed, 5 Jan 2005 10:54:31 +0000 (10:54 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Wed, 5 Jan 2005 10:54:31 +0000 (10:54 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9432 a592a061-630c-0410-9148-cb99ea01b6c8

17 files changed:
src/ChangeLog
src/frontends/gnome/lyx_gui.C
src/frontends/gtk/ChangeLog
src/frontends/gtk/lyx_gui.C
src/frontends/gtk/xftFontLoader.C
src/frontends/qt2/ChangeLog
src/frontends/qt2/QPrefs.C
src/frontends/qt2/lyx_gui.C
src/frontends/qt2/qfont_loader.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/lyx_gui.C
src/frontends/xforms/xfont_loader.C
src/graphics/ChangeLog
src/graphics/PreviewLoader.C
src/lyxrc.C
src/lyxrc.h

index dd31bd9fa074a004d1dcf17e2ebaee13fd5d606b..e101c4fda12f48784d4a2564db1e2aad3b46b75c 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-05  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * lyxrc.[Ch]: store all float values as strings.
+       use int (not float) for lyxrc.dpi.
+
 2005-01-04  Angus Leeming  <leeming@lyx.org>
 
        * lyx_cb.C (Reconfigure):
index 13e4607d86ac3960b19c0b8f0404d437606e9397..eac418cb20aff9a595cf31addf2c24d03291dac4 100644 (file)
@@ -72,11 +72,11 @@ namespace {
 bool finished = false;
 
 /// estimate DPI from X server
-float getDPI()
+int getDPI()
 {
        Screen * scr = ScreenOfDisplay(fl_get_display(), fl_screen);
-       return ((HeightOfScreen(scr) * 25.4 / HeightMMOfScreen(scr)) +
-               (WidthOfScreen(scr) * 25.4 / WidthMMOfScreen(scr))) / 2;
+       return int(((HeightOfScreen(scr) * 25.4 / HeightMMOfScreen(scr)) +
+               (WidthOfScreen(scr) * 25.4 / WidthMMOfScreen(scr))) / 2);
 }
 
 
index a7484eb3afda39ffef61a918346d4bda26104c89..332f84a1a27f60eda3b49fd53305281e3b961831 100644 (file)
@@ -1,4 +1,8 @@
-2005-04-01  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+2005-01-04  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * xftFontLoader.C: lyxrc.font_sizes is a string now.
+
+2005-01-04  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
        * GGraphics.C: more precise checks for the value strings.
 
index 68fd498501aa59756ccb75d7843079e890689a44..0d940337e0916415d5ecd59f6c613c3d391e7bae 100644 (file)
@@ -92,11 +92,11 @@ bool finished = false;
 
 
 /// estimate DPI from X server
-float getDPI()
+int getDPI()
 {
        Screen * scr = ScreenOfDisplay(getDisplay(), getScreen());
-       return ((HeightOfScreen(scr) * 25.4 / HeightMMOfScreen(scr)) +
-               (WidthOfScreen(scr) * 25.4 / WidthMMOfScreen(scr))) / 2;
+       return int(((HeightOfScreen(scr) * 25.4 / HeightMMOfScreen(scr)) +
+               (WidthOfScreen(scr) * 25.4 / WidthMMOfScreen(scr))) / 2);
 }
 
 
index 408a46398b3667fe8b8cfdfcf10d0246b6b209a0..098d3a2e34df6d7b3a2cd1694ff40e8144321945 100644 (file)
 #include "frontends/LyXView.h"
 #include "frontends/lyx_gui.h"
 
+#include "support/lstrings.h"
 #include "support/systemcall.h"
 #include "support/filetools.h"
 
 #include <cmath>       // fabs()
 #include <vector>
 
+using lyx::support::strToDbl;
 
 using std::endl;
 using std::string;
@@ -129,7 +131,7 @@ XftPattern * xftFontLoader::getFontPattern(LyXFont::FONT_FAMILY family,
        string ffamily;
        int fweight;
        int fslant;
-       double fsize = lyxrc.font_sizes[size] * lyxrc.zoom / 100.0;
+       double fsize = strToDbl(lyxrc.font_sizes[size]) * lyxrc.zoom / 100.0;
        XftPattern *fpat = XftPatternCreate();
 
        ffamily = familyString(family);
index de8228a1a083488c61b7d6b64e812d27c8378bd6..77262cda38aa0a54bc79e2e23330bec460cc83b6 100644 (file)
@@ -1,3 +1,10 @@
+2005-01-05  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * QPrefs.C: store all float/double values as strings.
+       lyxrc.dpi is an int value now.
+       
+       * QFontLoader.C: lyxrc.font_sizes is a string now.
+
 2005-01-05  Lars Gullik Bjonnes  <larsbj@gullik.net>
 
        * ui/Makefile.am (libqt2ui_la_LINK): Improve the trick to avoid
index 20d5a4ac09a1e3c1a7a06fd860b5c83f41207550..39a469eca0fdd12ebb32a5d188d8aa3822172379 100644 (file)
@@ -37,7 +37,6 @@
 #include "lyxfont.h"
 
 #include "support/lstrings.h"
-#include "support/tostr.h"
 
 #include "controllers/ControlPrefs.h"
 #include "controllers/frnt_lang.h"
@@ -309,16 +308,16 @@ void QPrefs::apply()
 
        rc.zoom = fontmod->screenZoomSB->value();
        rc.dpi = fontmod->screenDpiSB->value();
-       rc.font_sizes[LyXFont::SIZE_TINY] = strToDbl(fromqstr(fontmod->screenTinyED->text()));
-       rc.font_sizes[LyXFont::SIZE_SCRIPT] = strToDbl(fromqstr(fontmod->screenSmallestED->text()));
-       rc.font_sizes[LyXFont::SIZE_FOOTNOTE] = strToDbl(fromqstr(fontmod->screenSmallerED->text()));
-       rc.font_sizes[LyXFont::SIZE_SMALL] = strToDbl(fromqstr(fontmod->screenSmallED->text()));
-       rc.font_sizes[LyXFont::SIZE_NORMAL] = strToDbl(fromqstr(fontmod->screenNormalED->text()));
-       rc.font_sizes[LyXFont::SIZE_LARGE] = strToDbl(fromqstr(fontmod->screenLargeED->text()));
-       rc.font_sizes[LyXFont::SIZE_LARGER] = strToDbl(fromqstr(fontmod->screenLargerED->text()));
-       rc.font_sizes[LyXFont::SIZE_LARGEST] = strToDbl(fromqstr(fontmod->screenLargestED->text()));
-       rc.font_sizes[LyXFont::SIZE_HUGE] = strToDbl(fromqstr(fontmod->screenHugeED->text()));
-       rc.font_sizes[LyXFont::SIZE_HUGER] = strToDbl(fromqstr(fontmod->screenHugerED->text()));
+       rc.font_sizes[LyXFont::SIZE_TINY] = fromqstr(fontmod->screenTinyED->text());
+       rc.font_sizes[LyXFont::SIZE_SCRIPT] = fromqstr(fontmod->screenSmallestED->text());
+       rc.font_sizes[LyXFont::SIZE_FOOTNOTE] = fromqstr(fontmod->screenSmallerED->text());
+       rc.font_sizes[LyXFont::SIZE_SMALL] = fromqstr(fontmod->screenSmallED->text());
+       rc.font_sizes[LyXFont::SIZE_NORMAL] = fromqstr(fontmod->screenNormalED->text());
+       rc.font_sizes[LyXFont::SIZE_LARGE] = fromqstr(fontmod->screenLargeED->text());
+       rc.font_sizes[LyXFont::SIZE_LARGER] = fromqstr(fontmod->screenLargerED->text());
+       rc.font_sizes[LyXFont::SIZE_LARGEST] = fromqstr(fontmod->screenLargestED->text());
+       rc.font_sizes[LyXFont::SIZE_HUGE] = fromqstr(fontmod->screenHugeED->text());
+       rc.font_sizes[LyXFont::SIZE_HUGER] = fromqstr(fontmod->screenHugerED->text());
 
        if (rc.font_sizes != oldrc.font_sizes
                || rc.roman_font_name != oldrc.roman_font_name
@@ -619,17 +618,17 @@ void QPrefs::update_contents()
        dialog_->select_typewriter(fontmod->screenTypewriterCO->currentText());
 
        fontmod->screenZoomSB->setValue(rc.zoom);
-       fontmod->screenDpiSB->setValue(int(rc.dpi));
-       fontmod->screenTinyED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_TINY])));
-       fontmod->screenSmallestED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_SCRIPT])));
-       fontmod->screenSmallerED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_FOOTNOTE])));
-       fontmod->screenSmallED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_SMALL])));
-       fontmod->screenNormalED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_NORMAL])));
-       fontmod->screenLargeED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_LARGE])));
-       fontmod->screenLargerED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_LARGER])));
-       fontmod->screenLargestED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_LARGEST])));
-       fontmod->screenHugeED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_HUGE])));
-       fontmod->screenHugerED->setText(toqstr(tostr(rc.font_sizes[LyXFont::SIZE_HUGER])));
+       fontmod->screenDpiSB->setValue(rc.dpi);
+       fontmod->screenTinyED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_TINY]));
+       fontmod->screenSmallestED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_SCRIPT]));
+       fontmod->screenSmallerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_FOOTNOTE]));
+       fontmod->screenSmallED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_SMALL]));
+       fontmod->screenNormalED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_NORMAL]));
+       fontmod->screenLargeED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGE]));
+       fontmod->screenLargerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGER]));
+       fontmod->screenLargestED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_LARGEST]));
+       fontmod->screenHugeED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_HUGE]));
+       fontmod->screenHugerED->setText(toqstr(rc.font_sizes[LyXFont::SIZE_HUGER]));
 
        dialog_->updateFormats();
        dialog_->updateConverters();
index ea2f84ae2a9a77d357e797028e6568b17a1f1239..ad5a739347c5d3d782acff97911a5d4893b39072 100644 (file)
@@ -75,11 +75,11 @@ extern BufferList bufferlist;
 
 namespace {
 
-float getDPI()
+int getDPI()
 {
        QWidget w;
        QPaintDeviceMetrics pdm(&w);
-       return 0.5 * (pdm.logicalDpiX() + pdm.logicalDpiY());
+       return int(0.5 * (pdm.logicalDpiX() + pdm.logicalDpiY()));
 }
 
 map<int, shared_ptr<socket_callback> > socket_callbacks;
index 53fad3878eeb4aee77ee5a295a099d54ed4db077..62b3c05a8ad5304d7ef664e769a4bbd7072bdee0 100644 (file)
@@ -38,6 +38,7 @@ using lyx::support::LibFileSearch;
 using lyx::support::OnlyPath;
 using lyx::support::QuoteName;
 using lyx::support::Systemcall;
+using lyx::support::strToDbl;
 
 using std::endl;
 using std::make_pair;
@@ -315,7 +316,7 @@ qfont_loader::font_info::font_info(LyXFont const & f)
                }
        }
 
-       font.setPointSizeFloat(lyxrc.font_sizes[f.size()]
+       font.setPointSizeFloat(strToDbl(lyxrc.font_sizes[f.size()])
                               * lyxrc.zoom / 100.0);
 
        switch (f.series()) {
index feff0f1b1d5b84560d16bf2b03157b251156fbb2..fc328cc4a1fa5d9c9c16eead228401bddcdeb68e 100644 (file)
@@ -1,3 +1,10 @@
+2005-01-05  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * FormPreferences.C: store all float/double values as strings.
+       lyxrc.dpi is an int value now.
+       
+       * xfont_loader.C: lyxrc.font_sizes is a string now.
+
 2005-01-04  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
        * FormExternal.C: store all float/double values as strings.
index df41505316aeac2f30e20183b813d9cd7f4bbf6f..4593bddf5f8c8c378cb475daa7f99dee1f1556bd 100644 (file)
@@ -29,7 +29,6 @@
 #include "lyxfont.h"
 
 #include "support/lstrings.h"
-#include "support/tostr.h"
 #include "support/path_defines.h"
 #include "support/filetools.h"
 
@@ -2632,61 +2631,61 @@ void FormPreferences::ScreenFonts::apply(LyXRC & rc) const
                rc.dpi = ivalue;
        }
 
-       double dvalue = strToDbl(fl_get_input(dialog_->input_tiny));
+       string dvalue = fl_get_input(dialog_->input_tiny);
        if (rc.font_sizes[LyXFont::SIZE_TINY] != dvalue) {
                changed = true;
                rc.font_sizes[LyXFont::SIZE_TINY] = dvalue;
        }
 
-       dvalue = strToDbl(fl_get_input(dialog_->input_script));
+       dvalue = fl_get_input(dialog_->input_script);
        if (rc.font_sizes[LyXFont::SIZE_SCRIPT] != dvalue) {
                changed = true;
                rc.font_sizes[LyXFont::SIZE_SCRIPT] = dvalue;
        }
 
-       dvalue = strToDbl(fl_get_input(dialog_->input_footnote));
+       dvalue = fl_get_input(dialog_->input_footnote);
        if (rc.font_sizes[LyXFont::SIZE_FOOTNOTE] != dvalue) {
                changed = true;
                rc.font_sizes[LyXFont::SIZE_FOOTNOTE] = dvalue;
        }
 
-       dvalue = strToDbl(fl_get_input(dialog_->input_small));
+       dvalue = fl_get_input(dialog_->input_small);
        if (rc.font_sizes[LyXFont::SIZE_SMALL] != dvalue) {
                changed = true;
                rc.font_sizes[LyXFont::SIZE_SMALL] = dvalue;
        }
 
-       dvalue = strToDbl(fl_get_input(dialog_->input_normal));
+       dvalue = fl_get_input(dialog_->input_normal);
        if (rc.font_sizes[LyXFont::SIZE_NORMAL] != dvalue) {
                changed = true;
                rc.font_sizes[LyXFont::SIZE_NORMAL] = dvalue;
        }
 
-       dvalue = strToDbl(fl_get_input(dialog_->input_large));
+       dvalue = fl_get_input(dialog_->input_large);
        if (rc.font_sizes[LyXFont::SIZE_LARGE] != dvalue) {
                changed = true;
                rc.font_sizes[LyXFont::SIZE_LARGE] = dvalue;
        }
 
-       dvalue = strToDbl(fl_get_input(dialog_->input_larger));
+       dvalue = fl_get_input(dialog_->input_larger);
        if (rc.font_sizes[LyXFont::SIZE_LARGER] != dvalue) {
                changed = true;
                rc.font_sizes[LyXFont::SIZE_LARGER] = dvalue;
        }
 
-       dvalue = strToDbl(fl_get_input(dialog_->input_largest));
+       dvalue = fl_get_input(dialog_->input_largest);
        if (rc.font_sizes[LyXFont::SIZE_LARGEST] != dvalue) {
                changed = true;
                rc.font_sizes[LyXFont::SIZE_LARGEST] = dvalue;
        }
 
-       dvalue = strToDbl(fl_get_input(dialog_->input_huge));
+       dvalue = fl_get_input(dialog_->input_huge);
        if (rc.font_sizes[LyXFont::SIZE_HUGE] != dvalue) {
                changed = true;
                rc.font_sizes[LyXFont::SIZE_HUGE] = dvalue;
        }
 
-       dvalue = strToDbl(fl_get_input(dialog_->input_huger));
+       dvalue = fl_get_input(dialog_->input_huger);
        if (rc.font_sizes[LyXFont::SIZE_HUGER] != dvalue) {
                changed = true;
                rc.font_sizes[LyXFont::SIZE_HUGER] = dvalue;
@@ -2858,25 +2857,25 @@ void FormPreferences::ScreenFonts::update(LyXRC const & rc)
        fl_set_counter_value(dialog_->counter_zoom, rc.zoom);
        fl_set_counter_value(dialog_->counter_dpi,  rc.dpi);
        fl_set_input(dialog_->input_tiny,
-                    tostr(rc.font_sizes[LyXFont::SIZE_TINY]).c_str());
+                    rc.font_sizes[LyXFont::SIZE_TINY].c_str());
        fl_set_input(dialog_->input_script,
-                    tostr(rc.font_sizes[LyXFont::SIZE_SCRIPT]).c_str());
+                    rc.font_sizes[LyXFont::SIZE_SCRIPT].c_str());
        fl_set_input(dialog_->input_footnote,
-                    tostr(rc.font_sizes[LyXFont::SIZE_FOOTNOTE]).c_str());
+                    rc.font_sizes[LyXFont::SIZE_FOOTNOTE].c_str());
        fl_set_input(dialog_->input_small,
-                    tostr(rc.font_sizes[LyXFont::SIZE_SMALL]).c_str());
+                    rc.font_sizes[LyXFont::SIZE_SMALL].c_str());
        fl_set_input(dialog_->input_normal,
-                    tostr(rc.font_sizes[LyXFont::SIZE_NORMAL]).c_str());
+                    rc.font_sizes[LyXFont::SIZE_NORMAL].c_str());
        fl_set_input(dialog_->input_large,
-                    tostr(rc.font_sizes[LyXFont::SIZE_LARGE]).c_str());
+                    rc.font_sizes[LyXFont::SIZE_LARGE].c_str());
        fl_set_input(dialog_->input_larger,
-                    tostr(rc.font_sizes[LyXFont::SIZE_LARGER]).c_str());
+                    rc.font_sizes[LyXFont::SIZE_LARGER].c_str());
        fl_set_input(dialog_->input_largest,
-                    tostr(rc.font_sizes[LyXFont::SIZE_LARGEST]).c_str());
+                    rc.font_sizes[LyXFont::SIZE_LARGEST].c_str());
        fl_set_input(dialog_->input_huge,
-                    tostr(rc.font_sizes[LyXFont::SIZE_HUGE]).c_str());
+                    rc.font_sizes[LyXFont::SIZE_HUGE].c_str());
        fl_set_input(dialog_->input_huger,
-                    tostr(rc.font_sizes[LyXFont::SIZE_HUGER]).c_str());
+                    rc.font_sizes[LyXFont::SIZE_HUGER].c_str());
 }
 
 
index 5340ca36cf60e5a508f5ef5c75522bf62ab8b5fe..fcf67db9232ff5ab5b969b8fba42192bb258a6fe 100644 (file)
@@ -86,11 +86,11 @@ namespace {
 bool finished = false;
 
 /// estimate DPI from X server
-float getDPI()
+int getDPI()
 {
        Screen * scr = ScreenOfDisplay(fl_get_display(), fl_screen);
-       return ((HeightOfScreen(scr) * 25.4 / HeightMMOfScreen(scr)) +
-               (WidthOfScreen(scr) * 25.4 / WidthMMOfScreen(scr))) / 2;
+       return int(((HeightOfScreen(scr) * 25.4 / HeightMMOfScreen(scr)) +
+               (WidthOfScreen(scr) * 25.4 / WidthMMOfScreen(scr))) / 2);
 }
 
 
index 28030cb45beb3672fa84e5a29dfd6b4ab5416787..f9a1a74837e0a2544f3a53feb55bd0c12a843875 100644 (file)
@@ -20,6 +20,7 @@
 #include "frontends/lyx_gui.h"
 
 #include "support/filetools.h"
+#include "support/lstrings.h"
 #include "support/systemcall.h"
 
 #include "lyx_forms.h"
@@ -32,6 +33,7 @@ using std::string;
 namespace lyx {
 
 using support::LibFileSearch;
+using support::strToDbl;
 using support::OnlyPath;
 using support::Systemcall;
 
@@ -331,7 +333,7 @@ XFontStruct * xfont_loader::doLoad(LyXFont::FONT_FAMILY family,
 
        getFontinfo(family, series, shape);
        // FIXME! CHECK! Should we use 72.0 or 72.27? (Lgb)
-       int fsize = int((lyxrc.font_sizes[size] * lyxrc.dpi *
+       int fsize = int((strToDbl(lyxrc.font_sizes[size]) * lyxrc.dpi *
                          (lyxrc.zoom/100.0)) / 72.27 + 0.5);
 
        string font = fontinfo[family][series][shape]->getFontname(fsize);
index 3b95657fe1f3b0f7d33a55afa05bf0eca7fbdeec..78b1d44352adabecbc62dc13491e55d8fd5dde6d 100644 (file)
@@ -1,3 +1,7 @@
+2005-01-04  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * PreviewLoader.C: lyxrc.preview_scale_factor is a string now.
+
 2004-11-25  Lars Gullik Bjonnes  <larsbj@gullik.net>
 
        * rename a lot of InsetOld to InsetBase
index 9b8b084ae255e9015e59ee406326eb25cf06fb6b..2b1890338287b7ed52e2c0935de1446321329218 100644 (file)
@@ -317,7 +317,7 @@ PreviewLoader::Impl::Impl(PreviewLoader & p, Buffer const & b)
        : parent_(p), buffer_(b), font_scaling_factor_(0.0)
 {
        font_scaling_factor_ = 0.01 * lyxrc.dpi * lyxrc.zoom *
-               lyxrc.preview_scale_factor;
+               support::strToDbl(lyxrc.preview_scale_factor);
 
        lyxerr[Debug::GRAPHICS] << "The font scaling factor is "
                                << font_scaling_factor_ << endl;
index ea6f37b002281cb2073bb1b0ed6de2948b450f15..7128115c3de7996ef947f67f33a67fd3f78b48d6 100644 (file)
@@ -215,16 +215,16 @@ void LyXRC::setDefaults() {
        zoom = 150;
        wheel_jump = 5;
        // Default LaTeX font size:
-       font_sizes[LyXFont::SIZE_TINY] = 5.0;
-       font_sizes[LyXFont::SIZE_SCRIPT] = 7.0;
-       font_sizes[LyXFont::SIZE_FOOTNOTE] = 8.0;
-       font_sizes[LyXFont::SIZE_SMALL] = 9.0;
-       font_sizes[LyXFont::SIZE_NORMAL] = 10.0;
-       font_sizes[LyXFont::SIZE_LARGE] = 12.0;
-       font_sizes[LyXFont::SIZE_LARGER] = 14.4;
-       font_sizes[LyXFont::SIZE_LARGEST] = 17.26;
-       font_sizes[LyXFont::SIZE_HUGE] = 20.74;
-       font_sizes[LyXFont::SIZE_HUGER] = 24.88;
+       font_sizes[LyXFont::SIZE_TINY] = "5.0";
+       font_sizes[LyXFont::SIZE_SCRIPT] = "7.0";
+       font_sizes[LyXFont::SIZE_FOOTNOTE] = "8.0";
+       font_sizes[LyXFont::SIZE_SMALL] = "9.0";
+       font_sizes[LyXFont::SIZE_NORMAL] = "10.0";
+       font_sizes[LyXFont::SIZE_LARGE] = "12.0";
+       font_sizes[LyXFont::SIZE_LARGER] = "14.4";
+       font_sizes[LyXFont::SIZE_LARGEST] = "17.26";
+       font_sizes[LyXFont::SIZE_HUGE] = "20.74";
+       font_sizes[LyXFont::SIZE_HUGER] = "24.88";
        use_scalable_fonts = true;
        roman_font_name = "";
        sans_font_name = "";
@@ -272,7 +272,7 @@ void LyXRC::setDefaults() {
        label_init_length = 3;
        preview = PREVIEW_OFF;
        preview_hashed_labels  = false;
-       preview_scale_factor = 0.9;
+       preview_scale_factor = "0.9";
 
        user_name = lyx::support::user_name();
 
@@ -617,43 +617,43 @@ int LyXRC::read(LyXLex & lexrc)
                case RC_SCREEN_FONT_SIZES:
                        if (lexrc.next()) {
                                font_sizes[LyXFont::SIZE_TINY] =
-                                       lexrc.getFloat();
+                                       lexrc.getString();
                        }
                        if (lexrc.next()) {
                                font_sizes[LyXFont::SIZE_SCRIPT] =
-                                       lexrc.getFloat();
+                                       lexrc.getString();
                        }
                        if (lexrc.next()) {
                                font_sizes[LyXFont::SIZE_FOOTNOTE] =
-                                       lexrc.getFloat();
+                                       lexrc.getString();
                        }
                        if (lexrc.next()) {
                                font_sizes[LyXFont::SIZE_SMALL] =
-                                       lexrc.getFloat();
+                                       lexrc.getString();
                        }
                        if (lexrc.next()) {
                                font_sizes[LyXFont::SIZE_NORMAL] =
-                                       lexrc.getFloat();
+                                       lexrc.getString();
                        }
                        if (lexrc.next()) {
                                font_sizes[LyXFont::SIZE_LARGE] =
-                                       lexrc.getFloat();
+                                       lexrc.getString();
                        }
                        if (lexrc.next()) {
                                font_sizes[LyXFont::SIZE_LARGER] =
-                                       lexrc.getFloat();
+                                       lexrc.getString();
                        }
                        if (lexrc.next()) {
                                font_sizes[LyXFont::SIZE_LARGEST] =
-                                       lexrc.getFloat();
+                                       lexrc.getString();
                        }
                        if (lexrc.next()) {
                                font_sizes[LyXFont::SIZE_HUGE] =
-                                       lexrc.getFloat();
+                                       lexrc.getString();
                        }
                        if (lexrc.next()) {
                                font_sizes[LyXFont::SIZE_HUGER] =
-                                       lexrc.getFloat();
+                                       lexrc.getString();
                        }
                        break;
 
@@ -1107,7 +1107,7 @@ int LyXRC::read(LyXLex & lexrc)
 
                case RC_PREVIEW_SCALE_FACTOR:
                        if (lexrc.next()) {
-                               preview_scale_factor = lexrc.getFloat();
+                               preview_scale_factor = lexrc.getString();
                        }
                        break;
 
index 5cd5bc34b6036bade70afe485349b330e78ae050..187d61eb35a1f9041fdcbce72694ffb0ee5a4e11 100644 (file)
@@ -238,11 +238,11 @@ public:
        /// parameter for button_4 and button_5 (scrollwheel)
        unsigned int wheel_jump;
        /// Screen font sizes in points for each font size
-       float font_sizes[10];
+       std::string font_sizes[10];
        /// Allow the use of scalable fonts? Default is yes.
        bool use_scalable_fonts;
        /// DPI of monitor
-       float dpi;
+       unsigned int dpi;
        ///
        std::string fontenc;
        ///
@@ -369,7 +369,7 @@ public:
        ///
        bool preview_hashed_labels;
        ///
-       float preview_scale_factor;
+       std::string preview_scale_factor;
        /// user name
        std::string user_name;
        /// user email