Canvas news: Difference between revisions

Jump to navigation Jump to search
1,263 bytes added ,  27 March 2023
m
→‎2023: https://sourceforge.net/p/flightgear/mailman/message/37795864/
m (→‎2023: https://sourceforge.net/p/flightgear/mailman/message/37795864/)
Line 8: Line 8:


== 2023 ==
== 2023 ==
=== Pango Text ===
{{Stub}}
Successfully subclassed Pango::Renderer, and
I'm also successfully showing an osg::Texture2D as element on the canvas,
but when I try to copy an osgText::Glyph onto that texture, instead of a
glyph I get a noise texture instead … the other issue I'm having is some
ponter problem (a smart pointer of one CanvasPangoText instance only
getting deleted upon the creation of the next instance, which leads to it
wanting to delete something that was already deleted !?).
On both problems I'm somewhat stuck, so it would be great if @James Turner
<ja...@fl...>  or @Hooray could take a look - the latest code is
available at git.code.sf.net/u/thefgfseagle/simgear.git / branch
canvas_pangotext, in
simgear/canvas/elements/{CanvasPangoText,PangoRendererCanvas}.cxx<ref>https://sourceforge.net/p/flightgear/mailman/message/37795860/</ref>
And the new element can be tested with the following Nasal code, after
checking out the canvas_pangotext branch from
git.code.sf.net/u/thefgfseagle/fgdata <ref>https://sourceforge.net/p/flightgear/mailman/message/37795864/</ref>:
<pre>
w = canvas.Window.new([200, 200], "dialog");
c = w.createCanvas();
g = c.createGroup();
t = g.createChild("pangotext");
t.setMarkup("<b>bold</b>");
w.show();
</pre>
=== PUI Emulation ===
=== PUI Emulation ===
[[File:Gc-monitoring-via-new-canvas-proptree-widget.png|thumb|Screen shot showing a [[Canvas GUI]] dialog rendering the new [[Property browser]] dialog based on porting the legacy [[PUI]] widget, showing GC stats]]
[[File:Gc-monitoring-via-new-canvas-proptree-widget.png|thumb|Screen shot showing a [[Canvas GUI]] dialog rendering the new [[Property browser]] dialog based on porting the legacy [[PUI]] widget, showing GC stats]]

Navigation menu