[201_90] fix inner product symbol display in tab cycle popup#2939
[201_90] fix inner product symbol display in tab cycle popup#29391sh-repalto wants to merge 1 commit intoMoganLab:mainfrom
Conversation
|
Could you make it show |
|
Hello @JackYansongLi and @wumoin , - font fn= smart_font (family, fn_class, series, shape, sz, dpi);
+ font fn= find_font (family, fn_class, series, shape, sz, dpi);From my investigation, this change led to the unusual behaviour of the fixes I had done in my PR. Let me know what you guys think on this. I have tested both behaviours and am attaching them for reference:
with_smart_font.mp4
with_find_font.mp4 |
Using smart_font causes the program to crash and also leads to incorrect rendering. |
|
Thanks for the clarification @wumoin. I'll look into this issue again and try solve it with |
…nd fixing opacity
df8e879 to
f8b6da0
Compare
|
Hello @JackYansongLi @wumoin, I have modified the code to fix the rendering of tab cycle components. Here is a quick summary of what I did: Instead of forcing the basic C++ Let me know if this approach looks good. If so, I will update the developer document and PR description accordingly. Note: While fixing this issue I found some symbols that don't render properly in tab cycling but it's not a new issue as I checked on old version too they don't work properly. I'll raise new issues to fix them. Here is the state of tab cycling after this fix: fix_tab_cycling.mp4 |
|
The current changes significantly degrade the performance of tab cycling. In particular, the response becomes noticeably slower when pressing Tab to cycle through the options. You can observe the difference in the before-and-after video comparison. When holding down the Tab key continuously, the interface becomes noticeably laggy. tab.mp4 |
|
Hi @wumoin, thank you for pointing this out. My bad I didn't catch this. Does this seem like a correct approach ? Below is the code diff. I have also attached a screen recording demonstrating the before vs. after performance. Inside +// Cached result for texmacs_output_widget
+struct texmacs_output_cache_entry {
+ box b;
+ color col;
+ bool trans;
+};
+
widget
texmacs_output_widget (tree doc, tree style) {
+ // --- Cache lookup ---
+ static hashmap<tree, texmacs_output_cache_entry> output_cache;
+ tree cache_key= tuple (doc, style);
+ if (output_cache->contains (cache_key)) {
+ texmacs_output_cache_entry& e= output_cache (cache_key);
+ double zoom= (retina_zoom == 2 ? 1.0 : 1.2);
+ return widget (tm_new<box_widget_rep> (e.b, e.col, e.trans, zoom, 0, 0));
+ }
+
.
.
.
+
+ // --- Cache store ---
+ texmacs_output_cache_entry entry;
+ entry.b = b;
+ entry.col = col;
+ entry.trans= trans;
+ output_cache (cache_key)= entry;
+
double zoom= (retina_zoom == 2 ? 1.0 : 1.2);
return widget (tm_new<box_widget_rep> (b, col, trans, zoom, 0, 0));
}optimize_tab_cycling_performance.mp4 |
|
Initializing each symbol through a full typesetting environment is not a very good approach. I think this issue should be split into two separate parts: one is the display problem with I just took a look at the first problem, and I will submit a PR for it later. You can take a look at that then. |
|
You can look into how these symbols are rendered. I’ll close this PR for now. |
|
Got it, I'll create a new PR that addresses this issue based on the changes you have made in your PR. Should I wait for your PR to get merged first ? |




Fixes #2926
Inner product symbol does not show on Tab cycling popup window
Summary
When cycling through math variants for the
<key (which includes the inner product⟨⟩as the 7th variant), the popup window showed a broken/red symbol instead of the angle brackets.Developer Document:
devel/201_90.mdIssue Found
The
math-bracket-opencase inlambda-to-symbolwas concatenating the left and right bracket symbols (e.g.,"<langle><rangle>"). This produced a compound string that thewidget-boxrendering engine (using theromanfont) could not render correctly, showing as a red broken symbol or--.Changes
In
TeXmacs/progs/math/math-edit.scm:Modified
lambda-to-symbolto return only the left bracket symbol formath-bracket-open:((math-bracket-open) (and (>= (length (cdr body)) 2) (string? (cadr body)) (string? (caddr body)) (let ((lb (cadr body)) (rb (caddr body))) `(symbol-completion - ,(string-append lb rb))))) + ,lb))))How to test
$<Tabrepeatedly (7 times) to reach the inner product⟨⟩variant⟨clearly (instead of a broken red symbol or--)Tabonce more to return to<and verify the cycle continues correctly