Skip to content

Commit

Permalink
deploy: c0f9e19
Browse files Browse the repository at this point in the history
  • Loading branch information
noelwelsh committed Aug 5, 2024
1 parent 877079c commit 0e66074
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 13 deletions.
99 changes: 98 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let CanvasLayoutExamples,PulsingCircle,SvgParametricSpiral,CanvasFrameBackground,CanvasParametricSpiral,TextPositioning,ConcentricCircles,CanvasConcentricCircles,CanvasStyleExamples,DoodleLogo,Simple;
let CanvasLayoutExamples,PulsingCircle,SvgParametricSpiral,CanvasFrameBackground,CanvasParametricSpiral,TextPositioning,ConcentricCircles,CanvasConcentricCircles,CanvasStyleExamples,SvgTextExamples,DoodleLogo,Simple;
(function(){
'use strict';
var $linkingInfo = Object.freeze(({
Expand Down Expand Up @@ -18543,6 +18543,26 @@ function $f_Ldoodle_examples_StyleExamples__$init$__V($thiz) {
var elems$1 = $m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($d_Ldoodle_algebra_Picture.getArrayOf().constr)([$thiz.Ldoodle_examples_canvas_CanvasStyleExamples$__f_basicStyle, $thiz.Ldoodle_examples_canvas_CanvasStyleExamples$__f_strokeStyle, $thiz.Ldoodle_examples_canvas_CanvasStyleExamples$__f_fillStyle]));
$thiz.Ldoodle_examples_canvas_CanvasStyleExamples$__f_allPictures = $m_sci_Nil$().prependedAll__sc_IterableOnce__sci_List(elems$1);
}
function $f_Ldoodle_examples_TextExamples__$init$__V($thiz) {
$thiz.Ldoodle_examples_svg_SvgTextExamples$__f_hello = new $c_Ldoodle_syntax_TextSyntax$$anon$2("Hello from Doodle!");
var this$3 = $m_Ldoodle_syntax_package$all$();
var picture = new $c_Ldoodle_syntax_TextSyntax$$anon$2("Change the font");
var this$8 = new $c_Ldoodle_syntax_TextSyntax$TextPictureOps(this$3, picture);
var this$4 = $n($m_Ldoodle_core_font_Font$().Ldoodle_core_font_Font$__f_defaultSerif);
var weight = $m_Ldoodle_core_font_FontWeight$Bold$();
var family = this$4.Ldoodle_core_font_Font__f_family;
var style = this$4.Ldoodle_core_font_Font__f_style;
var size = this$4.Ldoodle_core_font_Font__f_size;
var this$7 = new $c_Ldoodle_core_font_Font(family, style, weight, size);
var size$1 = new $c_Ldoodle_core_font_FontSize$Points(24);
var family$1 = this$7.Ldoodle_core_font_Font__f_family;
var style$1 = this$7.Ldoodle_core_font_Font__f_style;
var weight$1 = this$7.Ldoodle_core_font_Font__f_weight;
var font = new $c_Ldoodle_core_font_Font(family$1, style$1, weight$1, size$1);
$thiz.Ldoodle_examples_svg_SvgTextExamples$__f_font = new $c_Ldoodle_syntax_TextSyntax$$anon$1(font, this$8);
var elems = $m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($d_Ldoodle_algebra_Picture.getArrayOf().constr)([$thiz.Ldoodle_examples_svg_SvgTextExamples$__f_hello, $thiz.Ldoodle_examples_svg_SvgTextExamples$__f_font]));
$thiz.Ldoodle_examples_svg_SvgTextExamples$__f_allPictures = $m_sci_Nil$().prependedAll__sc_IterableOnce__sci_List(elems);
}
/** @constructor */
function $c_Ldoodle_examples_canvas_CanvasParametricSpiral$() {
this.Ldoodle_examples_canvas_CanvasParametricSpiral$__f_marker = null;
Expand Down Expand Up @@ -20629,6 +20649,29 @@ var $d_Ldoodle_syntax_TextSyntax$$anon$1 = new $TypeData().initClass($c_Ldoodle_
Ldoodle_algebra_Picture: 1
}));
/** @constructor */
function $c_Ldoodle_syntax_TextSyntax$$anon$2(text$2) {
this.Ldoodle_syntax_TextSyntax$$anon$2__f_text$1 = null;
this.Ldoodle_syntax_TextSyntax$$anon$2__f_text$1 = text$2;
}
$c_Ldoodle_syntax_TextSyntax$$anon$2.prototype = new $h_O();
$c_Ldoodle_syntax_TextSyntax$$anon$2.prototype.constructor = $c_Ldoodle_syntax_TextSyntax$$anon$2;
/** @constructor */
function $h_Ldoodle_syntax_TextSyntax$$anon$2() {
}
$h_Ldoodle_syntax_TextSyntax$$anon$2.prototype = $c_Ldoodle_syntax_TextSyntax$$anon$2.prototype;
$c_Ldoodle_syntax_TextSyntax$$anon$2.prototype.apply__Ldoodle_algebra_Text__O = (function(algebra) {
var this$1 = $n(algebra);
var text = this.Ldoodle_syntax_TextSyntax$$anon$2__f_text$1;
return $f_Ldoodle_algebra_generic_GenericText__text__T__Ldoodle_algebra_generic_Finalized(this$1, text);
});
$c_Ldoodle_syntax_TextSyntax$$anon$2.prototype.apply__Ldoodle_algebra_Algebra__O = (function(algebra) {
return this.apply__Ldoodle_algebra_Text__O($as_Ldoodle_algebra_Text(algebra));
});
var $d_Ldoodle_syntax_TextSyntax$$anon$2 = new $TypeData().initClass($c_Ldoodle_syntax_TextSyntax$$anon$2, "doodle.syntax.TextSyntax$$anon$2", ({
Ldoodle_syntax_TextSyntax$$anon$2: 1,
Ldoodle_algebra_Picture: 1
}));
/** @constructor */
function $c_Ldoodle_syntax_TraverseSyntax$$anon$1() {
}
$c_Ldoodle_syntax_TraverseSyntax$$anon$1.prototype = new $h_O();
Expand Down Expand Up @@ -28471,9 +28514,15 @@ function $m_Ldoodle_core_Vec$() {
}
/** @constructor */
function $c_Ldoodle_core_font_Font$() {
this.Ldoodle_core_font_Font$__f_defaultSerif = null;
this.Ldoodle_core_font_Font$__f_defaultSansSerif = null;
$n_Ldoodle_core_font_Font$ = this;
$m_Ldoodle_core_font_Font$();
var family = $m_Ldoodle_core_font_FontFamily$Serif$();
var style = $m_Ldoodle_core_font_FontStyle$Normal$();
var weight = $m_Ldoodle_core_font_FontWeight$Normal$();
var size = new $c_Ldoodle_core_font_FontSize$Points(12);
this.Ldoodle_core_font_Font$__f_defaultSerif = new $c_Ldoodle_core_font_Font(family, style, weight, size);
$m_Ldoodle_core_font_Font$();
var family$1 = $m_Ldoodle_core_font_FontFamily$SansSerif$();
var style$1 = $m_Ldoodle_core_font_FontStyle$Normal$();
Expand Down Expand Up @@ -28582,6 +28631,53 @@ function $m_Ldoodle_examples_canvas_CanvasStyleExamples$() {
return $n_Ldoodle_examples_canvas_CanvasStyleExamples$;
}
/** @constructor */
function $c_Ldoodle_examples_svg_SvgTextExamples$() {
this.Ldoodle_examples_svg_SvgTextExamples$__f_hello = null;
this.Ldoodle_examples_svg_SvgTextExamples$__f_font = null;
this.Ldoodle_examples_svg_SvgTextExamples$__f_allPictures = null;
$n_Ldoodle_examples_svg_SvgTextExamples$ = this;
$f_Ldoodle_examples_TextExamples__$init$__V(this);
}
$c_Ldoodle_examples_svg_SvgTextExamples$.prototype = new $h_O();
$c_Ldoodle_examples_svg_SvgTextExamples$.prototype.constructor = $c_Ldoodle_examples_svg_SvgTextExamples$;
/** @constructor */
function $h_Ldoodle_examples_svg_SvgTextExamples$() {
}
$h_Ldoodle_examples_svg_SvgTextExamples$.prototype = $c_Ldoodle_examples_svg_SvgTextExamples$.prototype;
$c_Ldoodle_examples_svg_SvgTextExamples$.prototype.allPictures__sci_Seq = (function() {
return this.Ldoodle_examples_svg_SvgTextExamples$__f_allPictures;
});
$c_Ldoodle_examples_svg_SvgTextExamples$.prototype.drawHello__T__V = (function(id) {
var this$1 = $m_Ldoodle_syntax_package$all$();
var picture = this.Ldoodle_examples_svg_SvgTextExamples$__f_hello;
new $c_Ldoodle_syntax_AbstractRendererSyntax$RendererPictureOps(this$1, picture).drawWithFrame__O__Ldoodle_effect_Renderer__Lcats_effect_unsafe_IORuntime__V($n($m_Ldoodle_svg_package$().Ldoodle_svg_package$__f_Frame).apply__T__Ldoodle_svg_effect_Frame(id), $m_Ldoodle_svg_package$().Ldoodle_svg_package$__f_svgRenderer, $m_Lcats_effect_unsafe_IORuntime$().global__Lcats_effect_unsafe_IORuntime());
});
$c_Ldoodle_examples_svg_SvgTextExamples$.prototype.drawfont__T__V = (function(id) {
var this$1 = $m_Ldoodle_syntax_package$all$();
var picture = this.Ldoodle_examples_svg_SvgTextExamples$__f_font;
new $c_Ldoodle_syntax_AbstractRendererSyntax$RendererPictureOps(this$1, picture).drawWithFrame__O__Ldoodle_effect_Renderer__Lcats_effect_unsafe_IORuntime__V($n($m_Ldoodle_svg_package$().Ldoodle_svg_package$__f_Frame).apply__T__Ldoodle_svg_effect_Frame(id), $m_Ldoodle_svg_package$().Ldoodle_svg_package$__f_svgRenderer, $m_Lcats_effect_unsafe_IORuntime$().global__Lcats_effect_unsafe_IORuntime());
});
$c_Ldoodle_examples_svg_SvgTextExamples$.prototype.drawHello = (function(arg) {
var prep0 = $as_T(arg);
this.drawHello__T__V(prep0);
});
$c_Ldoodle_examples_svg_SvgTextExamples$.prototype.drawfont = (function(arg) {
var prep0 = $as_T(arg);
this.drawfont__T__V(prep0);
});
var $d_Ldoodle_examples_svg_SvgTextExamples$ = new $TypeData().initClass($c_Ldoodle_examples_svg_SvgTextExamples$, "doodle.examples.svg.SvgTextExamples$", ({
Ldoodle_examples_svg_SvgTextExamples$: 1,
Ldoodle_examples_BaseExamples: 1,
Ldoodle_examples_TextExamples: 1
}));
var $n_Ldoodle_examples_svg_SvgTextExamples$;
function $m_Ldoodle_examples_svg_SvgTextExamples$() {
if ((!$n_Ldoodle_examples_svg_SvgTextExamples$)) {
$n_Ldoodle_examples_svg_SvgTextExamples$ = new $c_Ldoodle_examples_svg_SvgTextExamples$();
}
return $n_Ldoodle_examples_svg_SvgTextExamples$;
}
/** @constructor */
function $c_Ldoodle_interact_animation_Interpolator$interpolatorInvariant$() {
}
$c_Ldoodle_interact_animation_Interpolator$interpolatorInvariant$.prototype = new $h_O();
Expand Down Expand Up @@ -73623,6 +73719,7 @@ TextPositioning = $m_Ldoodle_svg_TextPositioning$();
ConcentricCircles = $m_Ldoodle_svg_ConcentricCircles$();
CanvasConcentricCircles = $m_Ldoodle_examples_canvas_ConcentricCircles$();
CanvasStyleExamples = $m_Ldoodle_examples_canvas_CanvasStyleExamples$();
SvgTextExamples = $m_Ldoodle_examples_svg_SvgTextExamples$();
DoodleLogo = $m_Ldoodle_svg_DoodleLogo$();
Simple = $m_Ldoodle_examples_Simple$();
}).call(this);
Expand Down
8 changes: 4 additions & 4 deletions main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pictures/size.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ <h2 id="bounding-box" class="section">Bounding Box</h2>
.</span><span class="identifier">strokeColor</span><span>(</span><span class="type-name">Color</span><span>.</span><span class="identifier">hotpink</span><span>)
.</span><span class="identifier">strokeWidth</span><span>(</span><span class="number-literal">3.0</span><span>)
)
</span><span class="comment">// boundingBox: Picture[FromGifBase64 &amp; Basic &amp; Bitmap &amp; FromBufferedImage &amp; FromPngBase64 &amp; FromJpgBase64, Unit] = doodle.algebra.Picture$$anon$1@3e544f0e
</span><span class="comment">// boundingBox: Picture[FromGifBase64 &amp; Basic &amp; Bitmap &amp; FromBufferedImage &amp; FromPngBase64 &amp; FromJpgBase64, Unit] = doodle.algebra.Picture$$anon$1@5cf924b6
</span><span>
</span><span class="keyword">val</span><span> </span><span class="identifier">picture</span><span> = </span><span class="identifier">circle</span><span>.</span><span class="identifier">on</span><span>(</span><span class="identifier">boundingBox</span><span>)
</span><span class="comment">// picture: Picture[Bitmap &amp; FromBufferedImage &amp; FromPngBase64 &amp; FromGifBase64 &amp; Basic &amp; FromJpgBase64, Unit] = doodle.syntax.LayoutSyntax$$anon$1@b8aad6f</span></code></pre>
</span><span class="comment">// picture: Picture[Bitmap &amp; FromBufferedImage &amp; FromPngBase64 &amp; FromGifBase64 &amp; Basic &amp; FromJpgBase64, Unit] = doodle.syntax.LayoutSyntax$$anon$1@16e63eb3</span></code></pre>
<p>This produces the picture shown below.</p>
<div class="default-image-block">
<img src="bounding-box.png" alt="A circle with a bounding box" title="A circle with a bounding box">
Expand Down
10 changes: 4 additions & 6 deletions pictures/text.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ <h2 id="concept" class="section">Concept</h2>
</span><span class="type-name">Picture</span><span>
.</span><span class="identifier">text</span><span>(</span><span class="string-literal">&quot;Hello from Doodle!&quot;</span><span>)</span></code></pre>
<p>The output is shown below.</p>
<div class="default-image-block">
<img src="hello.png" alt="A picture showing the text Hello from Doodle!" title="Hello from Doodle!">
</div>
<div id="hello-example"></div>
<script>SvgTextExamples.drawHello("hello-example")</script>
<p>In addition to creating pictures containing text, it also allows specifying the <a class="api" href="https://javadoc.io/doc/org.creativescala/doodle-docs_3/latest/doodle/core/Font.html">Font</a> used for the text, via the <code>font</code> method.
In this example we use the default serif font, in bold weight and 24 point size.</p>
<pre><code class="nohighlight"><span class="keyword">import</span><span> </span><span class="identifier">doodle</span><span>.</span><span class="identifier">core</span><span>.</span><span class="identifier">font</span><span>.{</span><span class="type-name">Font</span><span>, </span><span class="type-name">FontSize</span><span>}
Expand All @@ -92,9 +91,8 @@ <h2 id="concept" class="section">Concept</h2>
.</span><span class="identifier">text</span><span>(</span><span class="string-literal">&quot;Change the font&quot;</span><span>)
.</span><span class="identifier">font</span><span>(</span><span class="type-name">Font</span><span>.</span><span class="identifier">defaultSerif</span><span>.</span><span class="identifier">bold</span><span>.</span><span class="identifier">size</span><span>(</span><span class="type-name">FontSize</span><span>.</span><span class="identifier">points</span><span>(</span><span class="number-literal">24</span><span>)))</span></code></pre>
<p>This produces the picture below.</p>
<div class="default-image-block">
<img src="font.png" alt="A picture showing the text Change the font" title="Change the font">
</div>
<div id="font-example"></div>
<script>SvgTextExamples.drawFont("font-example")</script>

<h2 id="implementation" class="section">Implementation</h2>
<p>These methods are available on both the <a class="api" href="https://javadoc.io/doc/org.creativescala/doodle-docs_3/latest/doodle/algebra/Text.html">Text</a> algebra and <a class="api" href="https://javadoc.io/doc/org.creativescala/doodle-docs_3/latest/doodle/image/Image.html">Image</a>.</p>
Expand Down

0 comments on commit 0e66074

Please sign in to comment.