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

Displaying Emoji in custom font is very slow #100278

Closed
edwin0cheng opened this issue Dec 11, 2024 · 3 comments · Fixed by #100300
Closed

Displaying Emoji in custom font is very slow #100278

edwin0cheng opened this issue Dec 11, 2024 · 3 comments · Fixed by #100300

Comments

@edwin0cheng
Copy link
Contributor

edwin0cheng commented Dec 11, 2024

Tested versions

  • Reproducible in 4.4 dev [cf038de]

System information

Godot v4.4.dev (cf038de) - Arch Linux #1 SMP PREEMPT_DYNAMIC Fri, 22 Nov 2024 16:04:27 +0000 on X11 - X11 display driver, Multi-window, 2 monitors - OpenGL 3 (Compatibility) - NVIDIA GeForce RTX 4060 Ti (nvidia; 565.57.01) - 13th Gen Intel(R) Core(TM) i7-13700 (24 threads)

Issue description

I found that using a custom font with emoji is very slow. It basically halt the editor.
It seem to relate to #88809 (I tried module_text_server_adv_enabled=no and module_text_server_fb_enabled=yes, but no luck)

And when I try to debug, it seem to spend all the time in XML Parsing for SVG.

I would like to help to debug and fix it but I am very new to Godot code base.

Steps to reproduce

  1. Add a custom font in project (I use https://fonts.google.com/noto/specimen/Noto+Color+Emoji)
  2. Go to Pre-render Configuration / Glyphs from Text :

Image

  1. Paste this text to the TextEdit Field:
😀😃😄😁😆🥹😅😂🤣😍😌😉🙃🙂😇😊☺️🥲🥰😘😗😙😚😋😛😝😜😏🥳🤩🥸😎🤓🧐🤨🤪😒😞😔😟😕🙁☹️😣😖🤬😡😠😤😭😢🥺😩😫🤯😳🥵🥶😶‍🌫️😱😨😰😥🫠🤫🫡🫢🤭🫣🤔🤗😓🤥😶🫥😐🫤😑😬🙄😯😮‍💨😪🤤😴🥱😲😮😧😦😵😵‍💫🤐🥴🤢🤮🤧😷🤒💩🤡👺👹👿😈🤠🤑🤕👻💀☠️👽👾🤖🎃😺😸🤲🫶😾😿🙀😽😼😻😹👐🙌👏🤝👍👎✊🤛👊🤏🤌👌🤘🤟🫰✌️🤞🤜🫳🫴👈👉👆👇☝️✋🤚🖕🦾💪🫱🫲🤙👋🖖🖐✍️🙏🫵🦶🦵🦿💄💋👄👀👁👣👃🦻👂👅🦷🫦🫀🫁🧠🗣👤👥🫂👶👧👩‍🦰👨‍🦱🧑‍🦱👩‍🦱👨🧑👩👦🧒🧑‍🦰👨‍🦰👱‍♀️👱👱‍♂️👩‍🦳🧑‍🦳👨‍🦳👩‍🦲👲👴🧓👵🧔‍♂️🧔🧔‍♀️👨‍🦲🧑‍🦲👳‍♀️👳👳‍♂️🧕👮‍♀️👮👮‍♂️👷‍♀️👷🧑‍⚕️👩‍⚕️🕵️‍♂️🕵️🕵️‍♀️💂‍♂️💂💂‍♀️👷‍♂️👨‍⚕️👩‍🌾🧑‍🌾👩‍🍳🧑‍🍳👨‍🍳👩‍🎓🧑‍🎓👨‍🌾🧑‍🏭👩‍🏭👨‍🏫🧑‍🏫👩‍🏫👨‍🎤🧑‍🎤👩‍🎤👨‍🎓👨‍🏭👩‍💻🧑‍💻👨‍💻👩‍💼🧑‍💼👨‍💼👩‍🔧🧑‍🔧🧑‍🚒👩‍🚒👨‍🎨🧑‍🎨👩‍🎨👨‍🔬🧑‍🔬👩‍🔬👨‍🔧👨‍🚒👩‍✈️🧑‍✈️👨‍✈️👩‍🚀🧑‍🚀👨‍🚀👩‍⚖️🧑‍⚖️🫅👸🤵‍♂️🤵🤵‍♀️👰‍♂️👰👰‍♀️👨‍⚖️🤴🥷🦸‍♀️🦸🦸‍♂️🦹🦹‍♂️🤶🦹‍♀️🧌🧝‍♂️🧝🧝‍♀️🧙‍♂️🧙🧙‍♀️🎅🧑‍🎄🧛‍♀️🧛🧛‍♂️🧟‍♀️🧟🧟‍♂️🧞‍♀️🧞🧞‍♂️🫄🤰👼🧚‍♂️🧚🧚‍♀️🧜‍♂️🧜🧜‍♀️🫃🤱👩‍🍼🧑‍🍼👨‍🍼🙇‍♀️🙇🙇‍♂️💁‍♀️🙋‍♀️🙆‍♂️🙆🙆‍♀️🙅‍♂️🙅🙅‍♀️💁‍♂️💁🙋🙋‍♂️🧏‍♀️🧏🧏‍♂️🤦‍♀️🤦🤦‍♂️🤷‍♀️💇‍♀️🙍‍♂️🙍🙍‍♀️🙎‍♂️🙎🙎‍♀️🤷‍♂️🤷💇💇‍♂️💆‍♀️💆💆‍♂️🧖‍♀️🧖🧖‍♂️💅🧑‍🦽👩‍🦽🕴👯‍♂️👯👯‍♀️🕺💃🤳👨‍🦽🧑‍🦼👨‍🦼🚶‍♀️🚶🚶‍♂️👩‍🦯🧑‍🦯🧍🧍‍♀️🏃‍♂️🏃🏃‍♀️🧎‍♂️🧎🧎‍♀️👨‍🦯🧍‍♂️👫👭👬👩‍❤️‍👨👩‍❤️‍👩💑👨‍❤️‍👨👩‍❤️‍💋‍👨👩‍👩‍👦👨‍👩‍👧‍👧👨‍👩‍👦‍👦👨‍👩‍👧‍👦👨‍👩‍👧👨‍👩‍👦👨‍❤️‍💋‍👨💏👩‍❤️‍💋‍👩👩‍👩‍👧👩‍👩‍👧‍👦👩‍👩‍👦‍👦👩‍👩‍👧‍👧👨‍👨‍👦👨‍👨‍👧👨‍👨‍👧‍👦👨‍👨‍👦‍👦👨‍👨‍👧‍👧👨‍👦‍👦👨‍👧‍👦👨‍👧👨‍👦👩‍👧‍👧👩‍👦‍👦👩‍👧‍👦👩‍👧👩‍👦👨‍👧‍👧🪢🧶🧵🪡🧥🥼🦺👚👘🩱👙👗👔🩳🩲👖👕🥻🩴🥿👠👡👢👞👟🥾🪖⛑👒🎓🧢🎩🧣🧤🧦👑💍👝👛👜💼🎒🧳👓🌂🥽🕶❤️🧡💛💚💙💜🤎🖤🤍💖💗💓💞💕❣️❤️‍🩹❤️‍🔥💔💘💝♡♥︎❥❦❧☙❢এლდღɞʚෆᰔᩚᰔঞଓᜊᥫ᭡ꨄஐᦗ🐶🐱🐭🐹🐰🦊🐻🐼🐻‍❄️🙈🐵🐸🐽🐷🐮🦁🐯🐨🙉🙊🐒🐔🐧🐦🐤🐣🐥🐝🦄🐴🐗🐺🦇🦉🦅🦆🪱🐛🦋🐌🐞🐜🪰🪲🪳🦖🦎🐍🐢🦂🕸🕷🦗🦟🦕🐙🦑🦐🦞🦀🐡🐠🐟🦓🐆🐅🐊🦭🦈🐋🐳🐬🦍🦧🦣🐘🦛🦏🐪🐫🦒🐑🐏🐖🐎🐄🐂🐃🦬🦘🦙🐐🦌🐕🐩🦮🐕‍🦺🐈🐈‍⬛🕊🦩🦢🦜🦚🦤🦃🐓🪶🐇🦝🦨🦡🦫🦦🦥🐁🐀🌳🌲🎄🌵🐲🐉🐾🦔🐿🌴🪵🌱🌿☘️🍀🎍🪴🎋🪨🪸🐚🍄🪹🪺🍁🍂🍃🌾💐🌷🌹🥀🪷🌺🌸🌼🌗🌖🌕🌚🌜🌛🌝🌞🌻🌘🌑🌒🌓🌔🌙🌎🌍🌏🔥💥☄️⚡️✨🌟⭐️💫🪐🌪🌈☀️🌤⛅️🌥☁️🌦🌧💧💨🌬⛄️☃️❄️🌨🌩⛈💦🫧☔️☂️🌊🍏🍎🍐🍊🍋🍌🍉🍇🍓🍅🥝🥥🍍🥭🍑🍒🍈🫐🍆🥑🥦🥬🥒🌶🫑🌽🥕🥖🍞🥯🥐🍠🥔🧅🧄🫒🥨🧀🥚🍳🧈🥞🧇🥓🥩🥪🫓🍕🍟🍔🌭🦴🍖🍗🥙🧆🌮🌯🫔🥗🥘🫕🥫🦪🥟🍱🍣🍛🍲🍜🍝🫙🍤🍙🍚🍘🍥🥠🥮🍢🍡🍭🍮🎂🍰🧁🥧🍦🍨🍧🍬🍫🍿🍩🍪🌰🥜🫘🍯🧋🥤🧃🍵☕️🫖🍼🫗🥛🍶🍺🍻🥂🍷🥃🍸🍹🧉🧂🥢🥡🥣🍽🍴🥄🧊🍾⚽️🏀🏈⚾️🥎🎾🏐🏉🥏🪃🏏🥍🏑🏒🏸🏓🪀🎱🥅⛳️🪁🛝🏹🎣🤿🥊🥋🏂⛷🎿🥌⛸🛷🛼🛹🎽🪂🏋️‍♀️🏋️🏋️‍♂️🤼‍♀️🤼🤼‍♂️🤸‍♀️🤸🏌️‍♀️🤾‍♂️🤾🤾‍♀️🤺⛹️‍♂️⛹️⛹️‍♀️🤸‍♂️🏌️🏌️‍♂️🏇🧘‍♀️🧘🧘‍♂️🏄‍♀️🏄🏄‍♂️🚣‍♂️🚣🚣‍♀️🤽‍♂️🤽🤽‍♀️🏊‍♂️🏊🏊‍♀️🧗‍♀️🧗🧗‍♂️🚵‍♀️🚵🚵‍♂️🚴‍♀️🚴🚴‍♂️🎫🎗🏵🎖🏅🥉🥈🥇🏆🎟🎪🤹‍♀️🤹🤹‍♂️🎭🩰🎨🎬🪗🎺🎷🪘🥁🎹🎼🎧🎤🎸🪕🎻🎲♟🎯🎳🎮🎰🧩🚗🚕🚙🚌🚎🏎🚓🚑🚒🩼🦼🦽🦯🚜🚛🚚🛻🚐🛴🚲🛵🏍🛺🛞🚨🚔🚍🚝🚞🚋🚃🚟🚠🚡🚖🚘🚄🚅🚈🚂🚆🚇🚊🚉✈️🛶🚁🛸🚀🛰💺🛩🛬🛫⛵️🚤🛥🛳🚢🛟⛴⚓️🪝🗼🗽🗿🗺🚏🚥🚦🚧⛽️🏰🏯🏟🎡🎢🎠⛲️⛱🏖🛖⛺️🏕🗻🏔⛰🌋🏜🏝🏠🏡🏘🏚🏗🏭🏢🏬🏣🏛💒🏩🏫🏪🏨🏦🏥🏤⛪️🕌🕍🛕🕋⛩🛤🛣🗾🌆🌇🎆🎇🌠🌄🌅🏞🎑🏙🌃🌌🌉🌁⌚️📱📲💻⌨️🖥🖨🖱🖲📸📷📼📀💿💾💽🗜🕹📹🎥📽🎞📞☎️📟📠📺🕰⏰⏲⏱🧭🎛🎚🎙📻⌛️⏳📡🔋🪫🔌💡🔦🕯🪙💷💶💴💵💸🛢🧯🪔💰💳🪪💎⚖️🪜🧰🪛🔧🧱🪤⚙️🔩🪚⛏🛠⚒🔨⛓🧲🔫💣🧨🪓🔪🗡⚔️🧿📿🔮🏺⚱️🪦⚰️🚬🛡🪬💈⚗️🔭🔬🕳🩻🩹🩺🧹🌡🧪🧫🦠🧬🩸💉💊🪠🧺🧻🚽🚰🚿🛁🛀🧼🚪🗝🔑🛎🧴🪣🧽🪒🪥🪑🛋🛏🛌🧸🪆🖼🪞🪟🎊🪅🪄🎀🎏🎈🎁🛒🛍🎉🎎🏮🎐🪩🧧✉️📩📨📫📪🪧🏷📦📤📥💌📧📬📭📮📯📜📃📄📑🧾📇🗑📅📆🗓🗒📉📈📊🗃🗳🗄📋📂📁🗂🗞📰📖📚📙📘📗📕📒📔📓🔖🧷🔗📎🖇📐📏🧮📌✏️📝🖍🖌✒️🖋🖊✂️📍🔍🔎🔏🔐🔒🔓❤️🧡💛💚💙💜🤎🖤🤍⚪️⚫️🟤🟣🔵🟢🟡🟠🔴🟥🟧🟨🟩🟦🟫⬛️⬜️❤️‍🩹❣️❤️‍🔥💔🏿🏾🏽🏼🏻💕💞💓💗💖💘💝💟☮️☦️☯️🕎🔯✡️☸️🕉☪️✝️🛐⛎♈️♉️♊️♋️♌️♍️♎️⚛️🆔♓️♒️♑️♐️♏️🉑☢️📴📳🈶🈚️🈸🈺🈷️✴️🈲🈹🈵🈴㊗️㊙️🉐💮🆚🅰️🅱️🆎🅾️🆑🆘❌⭕️🛑🚳🚯🚷♨️💢💯🚫📛⛔️🚱🔞📵🚭❗️❕❓❔‼️🔰⚜️🔱🚸⚠️〽️🔆🔅⁉️♻️✅🈯️💹❇️✳️❎🌐💠🈳🛗🅿️♿️🚾🏧💤🌀Ⓜ️🈂️🛂🛃🛄🛅🚹🚺🚼⚧🔡🔤ℹ️🔣🈁📶🎦🚮🚻🔠🆖🆗🆙🆒🆕🆓0️⃣1️⃣🔟9️⃣8️⃣7️⃣6️⃣5️⃣4️⃣3️⃣2️⃣🔢#️⃣*️⃣⏏️▶️⏸⏯⏹⏺🔽🔼◀️⏬⏫⏪⏩⏮⏭➡️⬅️⬆️⬇️↗️↘️↙️↖️↕️🔄🔂🔁🔀⤵️⤴️↩️↪️↔️🔃🎵🎶➕➖➗✖️🟰♾️🔛🔙🔚👁‍🗨®️©️™️💱💲🔝🔜〰️➰➿✔️☑️🔘🔺▫️▪️🔲🔳🔷🔶🔹🔸🔻◾️◽️◼️◻️🔈🔇🔉🔊🔔♥️♣️♠️🗯💭💬📢📣🔕♦️🃏🎴🀄️🕐🕑🕒🕓🕔🕝🕜🕛🕚🕙🕘🕗🕖🕕🕞🕟🕠🕡🕢🕣🕤🕥🕦🕧🏳️🏴🏴‍☠️🏁🚩🏳️‍🌈🏳️‍⚧️🇺🇳🇮🇸🇦🇱🇦🇼🇦🇷🇩🇿🇦🇪🇺🇸🇦🇫🇦🇿🇮🇪🇦🇲🇦🇮🇦🇴🇦🇬🇦🇩🇾🇪🇬🇧🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴󠁿🇺🇬🇼🇫🇮🇩🇮🇳🇮🇷🇮🇶🇮🇹🇮🇱🏴󠁧󠁢󠁷󠁬󠁳󠁿🇺🇦🇺🇿🇺🇾🇪🇨🇪🇬🇪🇪🇸🇿🇪🇹🇪🇷🇨🇻🇬🇭🇧🇶🇳🇱🇴🇲🇦🇽🇦🇹🇦🇺🇸🇻🇬🇬🇬🇾🇰🇿🇨🇦🇮🇨🇬🇦🇨🇲🇬🇲🇰🇬🇰🇮🇬🇷🇨🇼🇨🇺🇨🇾🇬🇼🇬🇳🇰🇭🇬🇹🇬🇵🇬🇺🇰🇼🇨🇰🇬🇱🇨🇽🇬🇩🇭🇷🇨🇬🇨🇴🇰🇲🇽🇰🇨🇷🇨🇨🇨🇮🇰🇪🇰🇾🇨🇩🇸🇦🇬🇸🇼🇸🇧🇱🇸🇹🇿🇲🇵🇲🇸🇲🇸🇽🇸🇬🇸🇾🇬🇪🇯🇲🇯🇪🇬🇮🇩🇯🇸🇱🇿🇼🇨🇭🇸🇪🇸🇩🇪🇸🇸🇷🇱🇰🇸🇰🇸🇮🇸🇧🇸🇴🇱🇨🇸🇭🇻🇨🇰🇳🇷🇸🇸🇳🇸🇨🇹🇨🇹🇭🇹🇯🇨🇿🇮🇴🇹🇩🇹🇳🇨🇱🇹🇲🇹🇹🇩🇲🇩🇴🇹🇰🇹🇬🇩🇪🇩🇰🇹🇻🇹🇷🇹🇴🇳🇬🇳🇷🇳🇦🇳🇺🇳🇮🇳🇪🇳🇨🇻🇦🇵🇰🇭🇹🇧🇭🇳🇴🇳🇫🇳🇵🇳🇿🇻🇺🇧🇸🇵🇬🇧🇲🇵🇼🇵🇾🇧🇧🇵🇸🇭🇺🇫🇰🇫🇴🇵🇷🇧🇹🇫🇮🇵🇭🇫🇯🇵🇳🇧🇩🇧🇷🇫🇷🇧🇬🇧🇫🇧🇳🇧🇮🇻🇳🇧🇯🇻🇪🇵🇹🇧🇴🇧🇼🇧🇦🇵🇱🇧🇪🇵🇪🇧🇿🇧🇾🇭🇳🇲🇭🇲🇴🇲🇬🇾🇹🇲🇼🇲🇱🇲🇹🇲🇶🇲🇨🇲🇿🇲🇷🇲🇺🇲🇽🇲🇲🇫🇲🇮🇲🇲🇾🇲🇻🇲🇩🇲🇦🇲🇳🇲🇪🇲🇸🇯🇴🇱🇻🇱🇧🇱🇸🇷🇼🇱🇺🇷🇴🇱🇷🇱🇮🇱🇾🇱🇹🇷🇪🇷🇺🇻🇬🇪🇺🇰🇷🇪🇭🇭🇰🇬🇶🇨🇫🇨🇳🇹🇱🇸🇸🇦🇶🇯🇵🎌🇬🇫🇵🇫🇰🇵🇲🇵🇲🇰🇦🇸🇻🇮🇹🇫✡✳✴❇☯✂☘✉✔✘⚧✏✒♟

Minimal reproduction project (MRP)

debug-text-bug.zip

@Calinou
Copy link
Member

Calinou commented Dec 11, 2024

cc @bruvzg

@AThousandShips
Copy link
Member

@edwin0cheng
Copy link
Contributor Author

Maybe I found where is the problem :

Ref<XMLParser> parser;
parser.instantiate();
parser->_open_buffer((const uint8_t *)document->svg_document, document->svg_document_length);

We parse the full SVG XML for every glyph slot, but we only use part of it. Normally, glyph slots share a few XML files that we could cache.

I would implement a PR for that if that is what we should do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants