HTML5画布中的桥文本效果

问题描述 投票:0回答:1

想要创建如下所示的Bridge Text Effect,我尝试使用arctext,但没有帮助。我尝试使用Google ID,但它不理解Bridge的文字形状。

<< img src =“ https://image.soinside.com/eyJ1cmwiOiAiaHR0cHM6Ly9pLnN0YWNrLmltZ3VyLmNvbS9WSU93VC5naWYifQ==” alt =“在此处输入图像描述”>“ >>

<!DOCTYPE HTML>
<html>
  <head>
    <style>
      body {
        margin: 0px;
        padding: 0px;
      }
    </style>
  </head>
  <body>
    <canvas id="myCanvas" width="578" height="200"></canvas>
    <script>
      var canvas = document.getElementById('myCanvas');
      var context = canvas.getContext('2d');
      var x = canvas.width / 2;
      var y = canvas.height / 2;

      context.font = '30pt Calibri';
      // textAlign aligns text horizontally relative to placement
      context.textAlign = 'center';
      // textBaseline aligns text vertically relative to font style
      context.textBaseline = 'middle';
      context.fillStyle = 'blue';
      context.fillText('BRIDGE TEXT', x, y);
    </script>
  </body>
</html>

想要创建如下所示的桥文字效果,我尝试使用arctext,但没有帮助。我尝试使用Google ID,但它不了解Bridge文字形状。 <...>

javascript html5 canvas
1个回答
3
投票

排量

© www.soinside.com 2019 - 2024. All rights reserved.