lojjic / aframe-troika-text Goto Github PK
View Code? Open in Web Editor NEWAn A-Frame component for rendering 3D text using troika-three-text
License: MIT License
An A-Frame component for rendering 3D text using troika-three-text
License: MIT License
I was trying to give a flashing animation to the text
<a-troika-text animation="property: opacity; from:0; to: 1 ; loop: true; dur: 5000" color="#EF2D5E" value="Hello world!"></a-troika-text>
Same code worked on normal But it's not working on troika-text,
When trying to load a new font URL into the text component I am getting an error that stops the text from rendering. When I use the regular font the render works fine, but when I change the font to Google Font's NotoSansSC and try to render some text (Hello), I get this error:
troika-worker-utils.esm.js:470
Uncaught (in promise) Error: Error in worker callModule call: Cannot read property '41' of undefined
at l. (troika-worker-utils.esm.js:470)
at Worker.t.onmessage (troika-worker-utils.esm.js:456)
The NotoSans font file is the .otf file directly downloaded from google fonts, it seems to load the font fine but it is when I load in a new text value that breaks the render.
would be nice to get the updated troika-3d-text package for the aframe build ( for three r117)
Hi, <a-troika-text>
is great but AFAICT can support only a single color
or font
or fontSize
properties.
That's fine for most cases but if one has to display a block of text, e.g a commit, and in particular code, it becomes limiting. I'm wondering how this could be done right.
My initial ideal would be to :
To avoid noticeable rendering delays when first using a font, we should add preloading capability. You can already handle the font file itself using <a-asset-item src="fontfile.woff">
, but we can additionally allow pregeneration of glyph SDFs using the preloadFont()
utility in troika-3d-text.
Is there any way to disable/suppress these warnings?
[Debug] unsupported GPOS table LookupType – 4 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5, x5)
[Debug] unsupported GPOS table LookupType – 5 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5)
[Debug] unsupported GPOS table LookupType – 4 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5, x2)
[Debug] unsupported GPOS table LookupType – 5 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5)
[Debug] unsupported GPOS table LookupType – 4 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5)
[Debug] unsupported GPOS table LookupType – 5 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5)
[Debug] unsupported GPOS table LookupType – 4 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5)
[Debug] unsupported GPOS table LookupType – 5 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5)
[Debug] unsupported GPOS table LookupType – 4 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5)
[Debug] unsupported GPOS table LookupType – 5 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5)
[Debug] unsupported GPOS table LookupType – 4 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5)
[Debug] unsupported GPOS table LookupType – 5 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5)
[Debug] unsupported GPOS table LookupType – 4 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5)
[Debug] unsupported GPOS table LookupType – 5 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5)
[Debug] unsupported GPOS table LookupType – 4 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5)
[Debug] unsupported GPOS table LookupType – 5 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5)
[Debug] unsupported GPOS table LookupType – 4 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5)
[Debug] unsupported GPOS table LookupType – 5 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5)
[Debug] unsupported GPOS table LookupType – 6 – "format" – 1 (dc85559f-cac5-4d24-82be-27d770c854d4, line 5, x3)
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
Warning
These dependencies are deprecated:
Datasource | Name | Replacement PR? |
---|---|---|
npm | rollup-plugin-node-resolve |
|
npm | rollup-plugin-terser |
These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
package.json
troika-three-text ^0.48.0
aframe 1.4.2
rollup 2.79.1
rollup-plugin-node-resolve 5.2.0
rollup-plugin-terser 7.0.2
aframe 1.1.x - 1.4.x
plz rename the component to troikatext had some problems with troika-text as component name and networked-aframe
Even though I have
<a-asset-item id="cfont" src="font.ttf"></a-asset-item>
This does not work:
<a-troika-text value="Text" font="#cfont"></a-troika-text>
Yet this does work:
<a-troika-text value="Text" font="font.ttf"></a-troika-text>
Hi,
I tried to repeat AdaRoseCannon/aframe-htmlmesh#4 here but it didn't work. I tried making a bounding box but the geometry was very different from what I expected, namely a square rather than a rectangle.
In the screenshot below I can show one that worked, the lower one, and one that didn't, despite using the same code
el = new THREE.BoxHelper( document.getElementById("locationreload").object3D.children[0], 0x00ff00 ); AFRAME.scenes[0].object3D.add(el)
Is somehow forcing a sync()
necessary? Did I miss a step? Note that I did that via the console and seconds after the scene was displayed so I'm relatively confident everything was loaded, at least displayed as it should. I also noticed #38 before but again, I'm not doing it right after adding the element so not sure it would relevant here.
Anyway, what is the recommended way to add a background behind an entire element or part of it?
PS: I noticed https://protectwise.github.io/troika/troika-three-text/#carets-and-selection-ranges that could later on be useful to highlight words or lines but didn't dive in there before being able to have the entire element.
Hello!
Very promising component. I've just started experimenting with it and I noticed that line breaks and tabs are not supported with \n
and \t
within the value
property.
<a-entity troika-text="value: Hello\nWorld!;"></a-entity>
I noticed it was in the documentation, so was hoping it would function as expected.
Should this be currently supported?
Thanks!
This component is awesome!
Only problem is trying to use Cambra.TTF, I keep getting
Failure loading font https:...; trying fallback TypeError: Cannot read properties of undefined (reading 'unitsPerEm')
Any way to fix?
with new threejs v110
Some properties are not working like fontSize, outlineColor, outlineWidth
please check the sample code
HI,
would it be possible to add some zOffset like text aframe component has it?
https://aframe.io/docs/0.9.0/components/text.html#properties_zoffset
Is it possible to fetch the height of an a-troika-text
primitive that's wrapping? I have a background for the text that I'd like to resize to the entire text's current height.
I noticed https://protectwise.github.io/troika/troika-three-text/#carets-and-selection-ranges and as I'm tinkering with the idea of a minimalist Vim in WebXR thought it could help. Are these functions accessible somehow from the component?
One can set font
per element but when having dozens it can grow verbose. defaultFontURL
can be modified directly also, as for now it relies on a Google server which might not be GDPR compliant. Yet it would be convenient to be able to set a default font for all <a-troika-text>
elements.
Same idea as aframevr/aframe#5119 so at least creating this issue as a form of documentation.
Hi,
i am trying to access bounding box for a layout script, but i can't read it (value always infinite).
i made troika-text the dependency of my component without result.
can you help me ?
See https://github.com/protectwise/troika/blob/master/packages/troika-3d-text/README.md#cliprect -- this hasn't been exposed yet.
troika text is not displayed at all in my iPhone 7 ( ios 14.7.1) , tried both primitive & component methods, "Could not get webgl version 2 " error was there. So I have enabled webgl2 in safari's settings, But still text wasn't showing up.
a-text is working fine
Hi,
I'm wondering if anybody worked on that, a way to text rich text, with some form of layout, and get it as AFrame (flat), content, and if so how (e.g probably stacking for difference scale, bolding with another font, etc).
Web version tested on an iPhone 8
No errors shown in the console.log
Regards
We're a few versions behind, missing some fixes and the newer features like stroke, fill opacity, outline offset, etc.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.