Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3d text chinese break #189

Open
wkl-coder opened this issue Aug 14, 2018 · 5 comments
Open

3d text chinese break #189

wkl-coder opened this issue Aug 14, 2018 · 5 comments

Comments

@wkl-coder
Copy link

image
this why break , if I show "未” is okay , this“妹” why the right “未” is break

@wkl-coder
Copy link
Author

I try "味道" and "泡沫" both okay , still I test only "妹" have question ,not sure other word

@wkl-coder
Copy link
Author

@dam00n did you check this ?

@radvani
Copy link
Contributor

radvani commented Aug 21, 2018

Hi, thanks for reporting this. We're going to investigate why that's happening. Would you mind sharing the snippet of code used to create that text?

@wkl-coder
Copy link
Author

try {
Text.TextBuilder textBuilder = Text.builder().fontSize(10).fontFamilies("Roboto, NotoSansCJK").height(0.1f).width(0.70f).maxLines(3).textString(word).viroContext(mViroView.getViroContext()).
clipMode(Text.ClipMode.NONE).color(Color.parseColor("#43dffd")).horizontalAlignment(Text.HorizontalAlignment.LEFT).verticalAlignment(Text.VerticalAlignment.TOP);

        //text.setFontFamilies("Roboto, NotoSansCJK");
        if (Locale.getDefault().getLanguage().equals("en")){
            textBuilder.lineBreakMode(Text.LineBreakMode.WORD_WRAP);
        }else if (Locale.getDefault().getLanguage().equals("zh")){
            textBuilder.lineBreakMode(Text.LineBreakMode.CHAR_WRAP);
        }else {
            textBuilder.lineBreakMode(Text.LineBreakMode.WORD_WRAP);
        }
         if (speech_node == null) {
            speech_node = new Node();
            mProductModelGroup.addChildNode(speech_node);
        }

            speech_node.setPosition(new Vector(0.30f, 0.488f, 0.2f)); //move this around to get into the lower right, maybe (.2, 0,0) would work better.

        Text text = textBuilder.build();

        text.setExtrusionDepth(2.0f);
        Material frontMaterial = new Material();
        if (kemoji_type.equals("banana_dance") || kemoji_type.equals("banana_tempt")) {
            frontMaterial.setDiffuseColor(Color.parseColor("#ECB82A"));
        } else if (kemoji_type.equals("bama_respect") || kemoji_type.equals("bama_mindful")) {
            frontMaterial.setDiffuseColor(Color.parseColor("#FE5E8B"));

        } else if (kemoji_type.equals("apple_spin") || kemoji_type.equals("apple_thinking")) {
            frontMaterial.setDiffuseColor(Color.parseColor("#3A766F"));

        } else {
            frontMaterial.setDiffuseColor(Color.parseColor("#43dffd"));
        }


        Material  backMaterial = new Material();
        backMaterial.setDiffuseColor(Color.BLACK);

        Material sideMaterial = new Material();
        sideMaterial.setDiffuseColor(Color.BLACK);

        List<Material> materials = Arrays.asList(frontMaterial, backMaterial, sideMaterial);
        text.setMaterials(materials);
      /*  EnumSet<Node.TransformBehavior> transformBehavior =
                EnumSet.of(Node.TransformBehavior.BILLBOARD_Y);
        speech_node.setTransformBehaviors(transformBehavior);*/
        speech_node.setLightReceivingBitMask(2);
        speech_node.setShadowCastingBitMask(0);
        speech_node.setScale(new Vector(0.45 , 0.45 , 0.45));
        speech_node.setOpacity(1f);
        speech_node.setGeometry(text);

@wkl-coder
Copy link
Author

the show 3d text code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants