本文介绍了Forge MArkups Freehand 字体大小和粗细的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在伪造查看器中绘制一个标记,但它在加载扩展时工作

var 扩展选项 = {隐藏问题按钮:假,hideFieldIssuesButton: 真,};

//使用 `viewer` 引用调用带有扩展名和扩展选项的 `loadExtension`:查看器[3d"].loadExtension('Autodesk.BIM360.Extension.PushPin', extensionOptions).then(function (extension){PushPinExtensionHandle = 扩展;});

但是绘制的粗细和字体非常小.如何增加大小?

请查找附件以供参考.

解决方案

在我看来,这篇文章是关于如何在 Forge Viewer 中设置字体大小和手绘粗细的.我不知道为什么代码片段是关于加载图钉扩展的.

不管怎样,我试着回答一下字体大小和手绘粗细的问题.

Markup Core 扩展提供了在创建文本时设置字体样式的参数.参数是一个json,其中font-size为一键.所以要设置字体大小,代码如下:

 markupExt.enterEditMode();var text1= new Autodesk.Viewing.Extensions.Markups.Core.CreateText(markupExt,2333,{x:10,y:10}, {x:100,y:100},'My Test String Small', {font-size":5})text1.execute();var text2= new Autodesk.Viewing.Extensions.Markups.Core.CreateText(markupExt,2333,{x:30,y:30}, {x:130,y:130},'My Test String Big', {font-size":20})text2.execute();

关于粗细,另一篇文章告诉现在设置笔画宽度.

I am trying to draw a Markups in forge Viewer but it's working when loading extension

var extensionOptions = {hideIssuesButton: false,hideFieldIssuesButton: true,};

  // Use the `viewer` reference to call `loadExtension` with the extension name and the extension options:

  viewer["3d"].loadExtension('Autodesk.BIM360.Extension.PushPin', extensionOptions).then(function (extension)
  {
      PushPinExtensionHandle = extension;
  });

but draw Thickness and Font Size is very small.How to increases the size?

Please find the attachment for reference.

解决方案

It looks to me the post is about how to set font size and freehand thickness of Markup in Forge Viewer. I am not sure why the code snippet is about loading Pushpin Extension.

anyway, let me try to answer the question of font size and freehand thickness.

Markup Core extension provides the parameter to set font style when you create text. The parameter is a json, in which font-size is one key. So to set font size, the code is like below:

 markupExt.enterEditMode();
 var text1= new Autodesk.Viewing.Extensions.Markups.Core.CreateText(markupExt,2333,
 {x:10,y:10}, {x:100,y:100},'My Test String Small', {"font-size":5})
  text1.execute();
 var text2= new Autodesk.Viewing.Extensions.Markups.Core.CreateText(markupExt,2333,
 {x:30,y:30}, {x:130,y:130},'My Test String Big', {"font-size":20})
  text2.execute();

As to thickness, the other post tells now to set stroke width.Autodesk Forge Viewer Markup Style Object

这篇关于Forge MArkups Freehand 字体大小和粗细的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 01:14