Add display_pixel_ratio to buffer params to use it for displays with high resolution.
It holds the highest ratio between physical pixels and device-independent pixels of the LyX application.
Preview snippets will be generated using this value to get high resolution preview.
}
+double Buffer::fontScalingFactor() const
+{
+ return isExporting() ? 75.0 * params().html_math_img_scale
+ : 0.01 * lyxrc.dpi * lyxrc.zoom * lyxrc.preview_scale_factor * params().display_pixel_ratio;
+}
+
+
ParagraphList & Buffer::paragraphs()
{
return text().paragraphs();
/// read the header, returns number of unknown tokens
int readHeader(Lexer & lex);
+ double fontScalingFactor() const;
+
private:
///
typedef std::map<Buffer const *, Buffer *> BufferMap;
html_math_output = MathML;
html_math_img_scale = 1.0;
html_css_as_file = false;
+ display_pixel_ratio = 1.0;
output_sync = false;
use_refstyle = true;
///
double html_math_img_scale;
///
+ double display_pixel_ratio;
+ ///
std::string html_latex_start;
///
std::string html_latex_end;
: parent_(p), ploader_(l), iloader_(bf),
snippet_(s), ascent_frac_(af)
{
+ iloader_.setDisplayPixelRatio(l.displayPixelRatio());
iloader_.connect(bind(&Impl::statusChanged, this));
}
return;
}
- double const font_scaling_factor =
- buffer_.isExporting() ? 75.0 * buffer_.params().html_math_img_scale
- : 0.01 * lyxrc.dpi * lyxrc.zoom * lyxrc.preview_scale_factor;
+ double const font_scaling_factor = buffer_.fontScalingFactor();
// The conversion command.
ostringstream cs;
}
+double PreviewLoader::displayPixelRatio() const
+{
+ return buffer().params().display_pixel_ratio;
+}
+
void PreviewLoader::Impl::finishedGenerating(pid_t pid, int retval)
{
// Paranoia check!
/// The foreground color used
static ColorCode foregroundColor() { return Color_preview; }
+ double displayPixelRatio() const ;
+
private:
/// noncopyable
PreviewLoader(PreviewLoader const &);