MCPcopy Create free account
hub / github.com/JetBrains/skija / draw

Method draw

examples/scenes/src/TextLineScene.java:207–237  ·  view source on GitHub ↗
(Canvas canvas, int width, int height, float dpi, int xpos, int ypos)

Source from the content-addressed store, hash-verified

205 }
206
207 @Override
208 public void draw(Canvas canvas, int width, int height, float dpi, int xpos, int ypos) {
209 Point cursor = new Point(xpos, ypos);
210 canvas.translate(20, 20);
211 cursor = cursor.offset(-20, -20);
212 if (_variants[_variantIdx].startsWith("Set 1")) {
213 cursor = cursor.offset(0, -drawIt(canvas, new String[] { "", "one", "yf", "два", "الخطوط", "🧛", "one yf الخطوط два 🧛" }, inter36, cursor));
214 if (zapfino18 != null)
215 cursor = cursor.offset(0, -drawIt(canvas, new String[] {"fiz officiad"}, zapfino18, cursor)); // swashes
216 // cursor = cursor.offset(0, -drawIt(canvas, "sixستةten", inter36, cursor));
217 cursor = cursor.offset(0, -drawIt(canvas, new String[] {"الكلب", "sixستةten", "one اثنان 12 واحد two"}, inter36, cursor)); // RTL
218 cursor = cursor.offset(0, -drawIt(canvas, new String[] {"<->", "a<->b", "🧑🏿", "a🧑🏿b"}, inter36, cursor)); // Ligatures
219 cursor = cursor.offset(0, -drawIt(canvas, new String[] {"x̆x̞̊x̃", "c̝̣̱̲͈̝ͨ͐̈ͪͨ̃ͥͅh̙̬̿̂a̯͎͍̜͐͌͂̚o̬s͉̰͊̀"}, inter36, cursor)); // Zero-witdh modifiers
220 cursor = cursor.offset(0, -drawIt(canvas, new String[] {"क्", "क्‍", "👨👩👧👦", "👨‍👩‍👧‍👦", "a👨‍👩‍👧‍👦b"}, inter36, cursor)); // ZWJ
221 cursor = cursor.offset(0, -drawIt(canvas, new String[] {"می‌خواهم‎", "میخواهم"}, inter36, cursor)); // ZWNJ
222 } else if (_variants[_variantIdx].startsWith("Set 2")) {
223 cursor = cursor.offset(0, -drawIt(canvas, new String[] {"", "🧛", "🧛🧛", "🧛a🧛", "a🧛a🧛a", "🧛 🧛"}, inter36, cursor));
224 cursor = cursor.offset(0, -drawIt(canvas, new String[] {"☹️", "☹️☹️", "☹️a☹️", "a☹️a☹️a", "☹️ ☹️"}, inter36, cursor));
225 cursor = cursor.offset(0, -drawIt(canvas, new String[] {"🤵🏽", "👨‍🏭", "🇦🇱", "*️⃣"}, inter36, cursor));
226 cursor = cursor.offset(0, -drawIt(canvas, new String[] {"🏴󠁧󠁢󠁳󠁣󠁴󠁿", "🚵🏻‍♀️"}, inter36, cursor));
227 cursor = cursor.offset(0, -drawIt(canvas, new String[] {"😮‍💨", "❤️‍🔥", "🧔‍♀", "👨🏻‍❤️‍💋‍👨🏼"}, inter36, cursor));
228 cursor = cursor.offset(0, -drawIt(canvas, new String[] {"Ǎ", "Ǎ", "x̆x̞̊x̃", "<->"}, inter36, cursor));
229 cursor = cursor.offset(0, -drawIt(canvas, new String[] {"Z̵̡̢͇͓͎͖͎̪͑͜ͅͅ"}, inter36, cursor));
230 } else if (_variants[_variantIdx].startsWith("Set 3")) {
231 cursor = cursor.offset(0, -drawIt(canvas, new String[] {"abcdef"}, inter36, cursor));
232 cursor = cursor.offset(0, -drawIt(canvas, new String[] {"-><=><->=>"}, inter36, cursor));
233 cursor = cursor.offset(0, -drawIt(canvas, new String[] {"aăå̞ã dấu hỏi k̟t̠ c̝̣̱̲͈̝ͨ͐̈ͪͨ̃ͥͅh̙̬̿̂a̯͎͍̜͐͌͂̚o̬s͉̰͊̀"}, jbMono36, cursor));
234 cursor = cursor.offset(0, -drawIt(canvas, new String[] {"☹️🤵🏽👨‍🏭🇦🇱*️⃣🏴󠁧󠁢󠁳󠁣󠁴󠁿🚵🏻‍♀️🤦🏼‍♂"}, inter36, cursor));
235 cursor = cursor.offset(0, -drawIt(canvas, new String[] {"🧔‍♀👨🏻‍❤️‍💋‍👨🏼"}, inter36, cursor));
236 }
237 }
238
239 // Furthermore, العربية نص جميل. द क्विक ब्राउन फ़ॉक्स jumps over the lazy 🐕.
240 // A true 🕵🏽‍♀️ will spot the tricky selection in this BiDi text: ניפגש ב09:35 בחוף הים

Callers

nothing calls this directly

Calls 3

offsetMethod · 0.95
drawItMethod · 0.95
translateMethod · 0.45

Tested by

no test coverage detected