Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[66_2] Add font_test on kernel L3 #1383

Merged
merged 4 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Plugins/Metafont/load_tex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include "load_pk.hpp"
#include "load_tfm.hpp"

void setup_tex ();
void init_tex ();
void load_tex (string family, int size, int dpi, int dsize,
tex_font_metric& tfm, font_glyphs& pk);

Expand Down
5 changes: 1 addition & 4 deletions src/System/Boot/init_texmacs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,10 @@
#include <QCoreApplication>
#include <QDir>
#endif
#include "Metafont/load_tex.hpp"

int install_status = 0;

extern void setup_tex (); // from Plugins/Metafont/tex_init.cpp
extern void init_tex (); // from Plugins/Metafont/tex_init.cpp


/******************************************************************************
* Texmacs paths
******************************************************************************/
Expand Down
11 changes: 8 additions & 3 deletions tests/L3/Graphics/Fonts/font_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,26 @@
* in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
******************************************************************************/

#include "Metafont/load_tex.hpp"
#include "base.hpp"
#include "font.hpp"
#include "sys_utils.hpp"
#include <QtTest/QtTest>

class TestFont : public QObject {
Q_OBJECT

private slots:
void init () { init_lolly (); }
void test_get_extents ();
};

void
TestFont::test_get_extents () {
// sys-chinese-rm-medium-right-10-600-smart
// font fn= smart_font ("sys-chinese", "rm", "medium", "right", 10, 600);
// cout << fn->res_name << LF;
set_new_fonts (true);
init_tex ();
font fn= smart_font ("sys-chinese", "rm", "medium", "right", 10, 600);
qcompare (fn->res_name, "sys-chinese-rm-medium-right-10-600-smart");
}

QTEST_MAIN (TestFont)
Expand Down
Loading