Creating a fast forward button with consistent visuals

조회 수: 22 (최근 30일)
Damien Watson
Damien Watson 2025년 12월 10일 10:07
댓글: Damien Watson 2025년 12월 10일 16:51
I have been making some audio control buttons such as a play button with:
uibutton(Text=char(0x23F5), FontName="monospaced")
Note that I am using the "Monospaced" font, which MATLAB is using for the editor and command window by default. This button shows the same symbol that would show in the command window if I were to print the text. This is the same for most of the media UTF-8 symbols.
However, if I run the same command, but using the code for the fast forward button, I get a different style symbol, despite explicitly defining the font that I want the button to use.
uibutton(Text=char(0x23E9), FontName="monospaced")
My question is what is causing this discrepancy, and how can I mitigate this?

채택된 답변

Matthew Moschella
Matthew Moschella 2025년 12월 10일 16:06
Did some investigating, seems like the uibutton uses the "Segoe UI Emoji" font when the text is a UTF-8 symbol.
I also see the 'all-black' version of the fast-forward button when I enter char(0x23E9) in the command window. If you copy and pase this into a Word document the symbol changes to the blue version you are seeing and the font is listed as "Segoe UI Emoji". Interestingly though, if you enter char(0x23F5) in the command window and copy that into a Word document you get a 'tofu' symbol.
Based on some google searching it appears that the Segoe UI Emoji font doesn't have a supported icon for the 0x23F5 symbol but it does have one for the 0x23E9 symbol. I imagine when MATLAB attempts to 'render' the 0x23F5 it is defaulting to another font that does have a supported symbol. Having said that, it's unclear why MATLAB is forcing a font other than the 'Monospaced' that you have declared.
I think the easiest solution is to use the 'Icon' property of uibutton to instead display images of these symbols.
  댓글 수: 1
Damien Watson
Damien Watson 2025년 12월 10일 16:51
Hmm, looks like you may be right. It is a shame to have to resort to using an icon (with SVG for infinite scaling), but I guess that might be the best solution for now.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

태그

제품


릴리스

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by