From 302865c8a51007b0cade0d3c0b5baa32e90dbe24 Mon Sep 17 00:00:00 2001 From: mattuy Date: Mon, 5 Oct 2020 20:58:37 +0800 Subject: [PATCH] fix example --- docs/deps/text-frame-min.js | 15 +++++++++++++++ docs/en/example.html | 2 +- docs/zh/example.html | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 docs/deps/text-frame-min.js diff --git a/docs/deps/text-frame-min.js b/docs/deps/text-frame-min.js new file mode 100644 index 0000000..63b3400 --- /dev/null +++ b/docs/deps/text-frame-min.js @@ -0,0 +1,15 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).TextFrame={})}(this,(function(t){"use strict"; +/*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */var e,n=function(){return(n=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0?l.fontSize*=a:l.fontSize=r.fontSize*a,l.lineHeight>0?l.lineHeight*=a:l.lineHeight=1.5*l.fontSize,l.textAlign in e||(l.textAlign=e.start),"object"==typeof l.margin&&null!==l)for(var o=0,f=["left","right","top","bottom"];o0&&(v.y+p+L.lineHeight>d+1?(f=null,O(),j()):v.y+=p),0!==s.lines.length||L.noHeadMargin||(v.y=c.top+L.margin.top),L.textIndent>0&&(v.x+=L.textIndent),f.offset.x=v.x,f.offset.y=v.y,m=u-L.margin.right,i=L.text,x=0;x=0;--R){if(F=f.chars[R],!g.lineStartProhibitedMarks.includes(k)&&!g.lineEndProhibitedMarks.includes(F)&&!g.unbreakableRule.test(F+k)){W=(M=k).length,T=o.measureText(M).width,x=I,f.chars=f.chars.slice(0,R+1);break}I-=k.length,k=F}j()}M&&f.chars.push(M),v.x+=T,x+=W}p=L.margin.bottom,y=L.marginCollapse}return H(),O(),h},t.renderFrame=function(t,e,n){if(!t)throw Error("error: text-frame - must provide drawing context!");if(e){var i=Math.round(e.options.canvasWidth),r=Math.round(e.options.canvasHeight);(n||t.canvas.width!==i||t.canvas.height!==r)&&(t.canvas.width=i,t.canvas.height=r);for(var a=0,l=e.lines;a - + diff --git a/docs/zh/example.html b/docs/zh/example.html index bb33bba..4795dd4 100644 --- a/docs/zh/example.html +++ b/docs/zh/example.html @@ -38,7 +38,7 @@ border: 1px solid darkgray; } - +