2023-03-21 07:59:24 +00:00
|
|
|
import ./make-test-python.nix (
|
|
|
|
{ pkgs, lib, ... }:
|
|
|
|
{
|
|
|
|
name = "noto-fonts-cjk-qt";
|
|
|
|
meta.maintainers = with lib.maintainers; [ oxalica ];
|
|
|
|
|
|
|
|
nodes.machine = {
|
|
|
|
imports = [ ./common/x11.nix ];
|
|
|
|
fonts = {
|
2023-07-24 15:33:39 +00:00
|
|
|
enableDefaultPackages = false;
|
2023-03-21 07:59:24 +00:00
|
|
|
fonts = [ pkgs.noto-fonts-cjk-sans ];
|
2024-12-10 19:26:33 +00:00
|
|
|
};
|
2023-03-21 07:59:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript =
|
|
|
|
let
|
|
|
|
script =
|
|
|
|
pkgs.writers.writePython3 "qt-default-weight"
|
|
|
|
{
|
|
|
|
libraries = [ pkgs.python3Packages.pyqt6 ];
|
|
|
|
}
|
|
|
|
''
|
|
|
|
from PyQt6.QtWidgets import QApplication
|
|
|
|
from PyQt6.QtGui import QFont, QRawFont
|
|
|
|
|
|
|
|
app = QApplication([])
|
|
|
|
f = QRawFont.fromFont(QFont("Noto Sans CJK SC", 20))
|
|
|
|
|
|
|
|
assert f.styleName() == "Regular", f.styleName()
|
2024-12-10 19:26:33 +00:00
|
|
|
'';
|
|
|
|
in
|
|
|
|
''
|
2023-03-21 07:59:24 +00:00
|
|
|
machine.wait_for_x()
|
|
|
|
machine.succeed("${script}")
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
)
|