Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

Edit: This is apparently only a problem on a mac running OSX.

I am trying to use the 'stretchText''stretchText' function by Jens. But when I use it in manipulate, the output keeps updating without changing anything.

This is the simplest example in which the problems occurs:

Manipulate[
 choice;

 Graphics[{
   stretchText["{", {0, 0}, {.1, 1}]
   }],
 
 {{choice, "b"}, {"a", "b"}},
 
 Initialization -> {
   stretchText[char_, pos_, scale_, angle_ : 0] := 
     Module[{g, coords, xMin, xMax, yMin, yMax}, 
      g = First@
        First@ImportString[ExportString[char, "PDF"], 
          "TextOutlines" -> True]; 
      coords = 
       Apply[Join, 
        Cases[g, FilledCurve[___, p_] :> Flatten[p, 1], 
         Infinity]]; {{xMin, xMax}, {yMin, yMax}} = 
       Map[{Min[#], Max[#]} &[#] &, Transpose[coords]]; 
      Rotate[Inset[
        Graphics[g, PlotRange -> {{xMin, xMax}, {yMin, yMax}}, 
         If[ListQ[scale], AspectRatio -> Full, 
          AspectRatio -> Automatic]], pos, {xMin, yMin}, scale], 
       angle]];
   }]

What can I do to stop the endless updating?

Edit: This is apparently only a problem on a mac running OSX.

I am trying to use the 'stretchText' function by Jens. But when I use it in manipulate, the output keeps updating without changing anything.

This is the simplest example in which the problems occurs:

Manipulate[
 choice;

 Graphics[{
   stretchText["{", {0, 0}, {.1, 1}]
   }],
 
 {{choice, "b"}, {"a", "b"}},
 
 Initialization -> {
   stretchText[char_, pos_, scale_, angle_ : 0] := 
     Module[{g, coords, xMin, xMax, yMin, yMax}, 
      g = First@
        First@ImportString[ExportString[char, "PDF"], 
          "TextOutlines" -> True]; 
      coords = 
       Apply[Join, 
        Cases[g, FilledCurve[___, p_] :> Flatten[p, 1], 
         Infinity]]; {{xMin, xMax}, {yMin, yMax}} = 
       Map[{Min[#], Max[#]} &[#] &, Transpose[coords]]; 
      Rotate[Inset[
        Graphics[g, PlotRange -> {{xMin, xMax}, {yMin, yMax}}, 
         If[ListQ[scale], AspectRatio -> Full, 
          AspectRatio -> Automatic]], pos, {xMin, yMin}, scale], 
       angle]];
   }]

What can I do to stop the endless updating?

Edit: This is apparently only a problem on a mac running OSX.

I am trying to use the 'stretchText' function by Jens. But when I use it in manipulate, the output keeps updating without changing anything.

This is the simplest example in which the problems occurs:

Manipulate[
 choice;

 Graphics[{
   stretchText["{", {0, 0}, {.1, 1}]
   }],
 
 {{choice, "b"}, {"a", "b"}},
 
 Initialization -> {
   stretchText[char_, pos_, scale_, angle_ : 0] := 
     Module[{g, coords, xMin, xMax, yMin, yMax}, 
      g = First@
        First@ImportString[ExportString[char, "PDF"], 
          "TextOutlines" -> True]; 
      coords = 
       Apply[Join, 
        Cases[g, FilledCurve[___, p_] :> Flatten[p, 1], 
         Infinity]]; {{xMin, xMax}, {yMin, yMax}} = 
       Map[{Min[#], Max[#]} &[#] &, Transpose[coords]]; 
      Rotate[Inset[
        Graphics[g, PlotRange -> {{xMin, xMax}, {yMin, yMax}}, 
         If[ListQ[scale], AspectRatio -> Full, 
          AspectRatio -> Automatic]], pos, {xMin, yMin}, scale], 
       angle]];
   }]

What can I do to stop the endless updating?

Added link to cited answer
Source Link
Michael E2
  • 244.7k
  • 18
  • 351
  • 774

Edit: This is apparently only a problem on a mac running OSX.

I am trying to use the 'stretchText''stretchText' function by Jens. But when I use it in manipulate, the output keeps updating without changing anything.

This is the simplest example in which the problems occurs:

Manipulate[
 choice;

 Graphics[{
   stretchText["{", {0, 0}, {.1, 1}]
   }],
 
 {{choice, "b"}, {"a", "b"}},
 
 Initialization -> {
   stretchText[char_, pos_, scale_, angle_ : 0] := 
     Module[{g, coords, xMin, xMax, yMin, yMax}, 
      g = First@
        First@ImportString[ExportString[char, "PDF"], 
          "TextOutlines" -> True]; 
      coords = 
       Apply[Join, 
        Cases[g, FilledCurve[___, p_] :> Flatten[p, 1], 
         Infinity]]; {{xMin, xMax}, {yMin, yMax}} = 
       Map[{Min[#], Max[#]} &[#] &, Transpose[coords]]; 
      Rotate[Inset[
        Graphics[g, PlotRange -> {{xMin, xMax}, {yMin, yMax}}, 
         If[ListQ[scale], AspectRatio -> Full, 
          AspectRatio -> Automatic]], pos, {xMin, yMin}, scale], 
       angle]];
   }]

What can I do to stop the endless updating?

Edit: This is apparently only a problem on a mac running OSX.

I am trying to use the 'stretchText' function by Jens. But when I use it in manipulate, the output keeps updating without changing anything.

This is the simplest example in which the problems occurs:

Manipulate[
 choice;

 Graphics[{
   stretchText["{", {0, 0}, {.1, 1}]
   }],
 
 {{choice, "b"}, {"a", "b"}},
 
 Initialization -> {
   stretchText[char_, pos_, scale_, angle_ : 0] := 
     Module[{g, coords, xMin, xMax, yMin, yMax}, 
      g = First@
        First@ImportString[ExportString[char, "PDF"], 
          "TextOutlines" -> True]; 
      coords = 
       Apply[Join, 
        Cases[g, FilledCurve[___, p_] :> Flatten[p, 1], 
         Infinity]]; {{xMin, xMax}, {yMin, yMax}} = 
       Map[{Min[#], Max[#]} &[#] &, Transpose[coords]]; 
      Rotate[Inset[
        Graphics[g, PlotRange -> {{xMin, xMax}, {yMin, yMax}}, 
         If[ListQ[scale], AspectRatio -> Full, 
          AspectRatio -> Automatic]], pos, {xMin, yMin}, scale], 
       angle]];
   }]

What can I do to stop the endless updating?

Edit: This is apparently only a problem on a mac running OSX.

I am trying to use the 'stretchText' function by Jens. But when I use it in manipulate, the output keeps updating without changing anything.

This is the simplest example in which the problems occurs:

Manipulate[
 choice;

 Graphics[{
   stretchText["{", {0, 0}, {.1, 1}]
   }],
 
 {{choice, "b"}, {"a", "b"}},
 
 Initialization -> {
   stretchText[char_, pos_, scale_, angle_ : 0] := 
     Module[{g, coords, xMin, xMax, yMin, yMax}, 
      g = First@
        First@ImportString[ExportString[char, "PDF"], 
          "TextOutlines" -> True]; 
      coords = 
       Apply[Join, 
        Cases[g, FilledCurve[___, p_] :> Flatten[p, 1], 
         Infinity]]; {{xMin, xMax}, {yMin, yMax}} = 
       Map[{Min[#], Max[#]} &[#] &, Transpose[coords]]; 
      Rotate[Inset[
        Graphics[g, PlotRange -> {{xMin, xMax}, {yMin, yMax}}, 
         If[ListQ[scale], AspectRatio -> Full, 
          AspectRatio -> Automatic]], pos, {xMin, yMin}, scale], 
       angle]];
   }]

What can I do to stop the endless updating?

Tweeted twitter.com/#!/StackMma/status/363310665005416449
added 64 characters in body
Source Link
Sofic
  • 673
  • 3
  • 8

Edit: This is apparently only a problem on a mac running OSX.

I am trying to use the 'stretchText' function by Jens. But when I use it in manipulate, the output keeps updating without changing anything.

This is the simplest example in which the problems occurs:

Manipulate[
 choice;

 Graphics[{
   stretchText["{", {0, 0}, {.1, 1}]
   }],
 
 {{choice, "b"}, {"a", "b"}},
 
 Initialization -> {
   stretchText[char_, pos_, scale_, angle_ : 0] := 
     Module[{g, coords, xMin, xMax, yMin, yMax}, 
      g = First@
        First@ImportString[ExportString[char, "PDF"], 
          "TextOutlines" -> True]; 
      coords = 
       Apply[Join, 
        Cases[g, FilledCurve[___, p_] :> Flatten[p, 1], 
         Infinity]]; {{xMin, xMax}, {yMin, yMax}} = 
       Map[{Min[#], Max[#]} &[#] &, Transpose[coords]]; 
      Rotate[Inset[
        Graphics[g, PlotRange -> {{xMin, xMax}, {yMin, yMax}}, 
         If[ListQ[scale], AspectRatio -> Full, 
          AspectRatio -> Automatic]], pos, {xMin, yMin}, scale], 
       angle]];
   }]

What can I do to stop the endless updating?

I am trying to use the 'stretchText' function by Jens. But when I use it in manipulate, the output keeps updating without changing anything.

This is the simplest example in which the problems occurs:

Manipulate[
 Graphics[{
   stretchText["{", {0, 0}, {.1, 1}]
   }],
 
 {{choice, "b"}, {"a", "b"}},
 
 Initialization -> {
   stretchText[char_, pos_, scale_, angle_ : 0] := 
     Module[{g, coords, xMin, xMax, yMin, yMax}, 
      g = First@
        First@ImportString[ExportString[char, "PDF"], 
          "TextOutlines" -> True]; 
      coords = 
       Apply[Join, 
        Cases[g, FilledCurve[___, p_] :> Flatten[p, 1], 
         Infinity]]; {{xMin, xMax}, {yMin, yMax}} = 
       Map[{Min[#], Max[#]} &[#] &, Transpose[coords]]; 
      Rotate[Inset[
        Graphics[g, PlotRange -> {{xMin, xMax}, {yMin, yMax}}, 
         If[ListQ[scale], AspectRatio -> Full, 
          AspectRatio -> Automatic]], pos, {xMin, yMin}, scale], 
       angle]];
   }]

What can I do to stop the endless updating?

Edit: This is apparently only a problem on a mac running OSX.

I am trying to use the 'stretchText' function by Jens. But when I use it in manipulate, the output keeps updating without changing anything.

This is the simplest example in which the problems occurs:

Manipulate[
 choice;

 Graphics[{
   stretchText["{", {0, 0}, {.1, 1}]
   }],
 
 {{choice, "b"}, {"a", "b"}},
 
 Initialization -> {
   stretchText[char_, pos_, scale_, angle_ : 0] := 
     Module[{g, coords, xMin, xMax, yMin, yMax}, 
      g = First@
        First@ImportString[ExportString[char, "PDF"], 
          "TextOutlines" -> True]; 
      coords = 
       Apply[Join, 
        Cases[g, FilledCurve[___, p_] :> Flatten[p, 1], 
         Infinity]]; {{xMin, xMax}, {yMin, yMax}} = 
       Map[{Min[#], Max[#]} &[#] &, Transpose[coords]]; 
      Rotate[Inset[
        Graphics[g, PlotRange -> {{xMin, xMax}, {yMin, yMax}}, 
         If[ListQ[scale], AspectRatio -> Full, 
          AspectRatio -> Automatic]], pos, {xMin, yMin}, scale], 
       angle]];
   }]

What can I do to stop the endless updating?

put as code
Source Link
Nasser
  • 150.4k
  • 12
  • 161
  • 374
Loading
Source Link
Sofic
  • 673
  • 3
  • 8
Loading