mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-30 21:24:14 +00:00
be0cd47559
This extends the already existing math symbol fallback mechanism in two ways: 1) When considering the availability of the math font, also take broken code points into account. These are currently 0x0009 and 0x00ad, depending on the platform. 2) If the fallback symbol in the standard "Symbol" font is not given, or if the "Symbol" font is not available, or the fallback symbol is one of the broken ones, try to use a generic unicode symbol as second fallback instead. If this is available, we rely on Qt to find a font which has it. Only if this is not available, display the symbol as ERT. This ensures that we do never get a symbol which is not displayed: Either it can be displayed, with or without fallback, or it will be shown as ERT.
57 lines
1.0 KiB
C++
57 lines
1.0 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file FontLoader.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Abdelrazak Younes
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef FONTLOADER_H
|
|
#define FONTLOADER_H
|
|
|
|
#include "support/strfwd.h"
|
|
|
|
namespace lyx {
|
|
|
|
class FontInfo;
|
|
|
|
namespace frontend {
|
|
|
|
class FontMetrics;
|
|
|
|
/// Hold info about a particular font
|
|
class FontLoader
|
|
{
|
|
public:
|
|
///
|
|
FontLoader();
|
|
/// Clears cache
|
|
~FontLoader();
|
|
|
|
/// Update fonts after zoom, dpi, font names, or norm change
|
|
// (basically by deleting all cached values)
|
|
void update();
|
|
|
|
/// Is the given font available ?
|
|
bool available(FontInfo const & f);
|
|
|
|
/// Can the given symbol be displayed in general?
|
|
bool canBeDisplayed(char_type c);
|
|
|
|
/// Get the Font metrics for this FontInfo
|
|
FontMetrics const & metrics(FontInfo const & f);
|
|
};
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
/// Implementation is in Application.cpp
|
|
extern frontend::FontLoader & theFontLoader();
|
|
|
|
} // namespace lyx
|
|
|
|
#endif // FONTLOADER_H
|