Skip to main content
14 events
when toggle format what by license comment
Feb 13, 2012 at 22:03 comment added Heike @MikeHoneychurch I'm glad it got sorted out
Feb 13, 2012 at 22:02 comment added Mike Honeychurch @Heike ok we're on the same page. I have misinterpreted Verbeias question.
Feb 13, 2012 at 21:51 comment added Heike @MikeHoneychurch Are you changing the font of the text in the box (using the FontSize and FontFamily options) or of the Cell itself? If I look at the last two screen grabs in your post, the font of the text in the boxes look the same to me, but the brackets and number are in a different style.
Feb 13, 2012 at 21:46 comment added Mike Honeychurch Actually when I commented above about not needing DynamicWrapper I hadn't tried your code. On my Mac your code doesn't work. The value of p is constant regardless of what you change the font size to, and consequently the image size never changes.
Feb 13, 2012 at 21:42 history edited Verbeia CC BY-SA 3.0
added Manipulate to explain why Heike's answer is the right one, and is totally cool
Feb 13, 2012 at 21:41 comment added Heike @MikeHoneychurch I'm using Mathematica 8.0.4 on OS X Lion 10.7.3.
Feb 13, 2012 at 21:40 comment added Mike Honeychurch @Verbeia As per my answer to Heike this must be a system specific problem because on Mac Snow Leopard my answer delivers exactly what your Manipulate does but much simpler -- as per screen grabs.
Feb 13, 2012 at 21:36 comment added Mike Honeychurch @Heike what are you using? I wrote my answer with 8.0.4 on OS X 10.6.8 and it works fine -- as per screen grabs.
Feb 13, 2012 at 21:26 comment added Verbeia @MikeHoneychurch but it seems to be the difference that makes it work. Consider Manipulate[{Framed@ Graphics[ Text[Style[ DynamicWrapper["how quickly daft jumping zebras vex", p = CurrentValue["FontNWidth"]], FontFamily -> "Verdana", FontSize -> i]], ImageSize -> Dynamic[p]*46], Dynamic[p]}, {i, 10, 40}]
Feb 13, 2012 at 21:24 comment added Heike @MikeHoneychurch That doesn't work on my system. If I run your edited code I always get a value of 7.02114 for CurrentValue["FontNWidth"] independent of FontSize and FontFamily.
Feb 13, 2012 at 21:22 vote accept Verbeia
Feb 13, 2012 at 21:10 comment added Mike Honeychurch I don;t see a need for a dynamic wrapper @Heike. As per my answer you can just make the current value Dynamic directly.
Feb 13, 2012 at 10:11 comment added rm -rf Neat! Someday, I should start looking into Dynamic*...
Feb 13, 2012 at 10:06 history answered Heike CC BY-SA 3.0