MCPcopy Create free account
hub / github.com/HumbleUI/Skija / dWriteUseSystemRenderingParams

Method dWriteUseSystemRenderingParams

tests/java/FontMgrTest.java:106–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

104 }
105
106 public void dWriteUseSystemRenderingParams() {
107 Typeface jbMono = FontMgr.getDefault().makeFromFile("fonts/JetBrainsMono-Regular.ttf", 0);
108 Font font = new Font(jbMono, 14);
109
110 try (Bitmap a = new Bitmap();
111 Paint p = new Paint();)
112 {
113 a.allocN32Pixels(10, 20);
114 try(Canvas canvas = new Canvas(a)) {
115 assertDoesNotThrow(() -> {
116 FontMgr.useSystemRenderingParams(true);
117 canvas.drawString("Test1", 0, 10, font, p);
118 FontMgr.useSystemRenderingParams(false);
119 canvas.drawString("Test2", 0, 20, font, p);
120 }
121 );
122 }
123 }
124
125 font.close();
126 jbMono.close();
127 }
128}

Callers

nothing calls this directly

Calls 7

getDefaultMethod · 0.95
allocN32PixelsMethod · 0.80
assertDoesNotThrowMethod · 0.80
makeFromFileMethod · 0.45
drawStringMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected