I'm using a TextArea in a stage in libgdx. On linux works great, but on Windows (7) when I write (or copy and paste) a long text to the TextArea, there is a region that do not display the text. The text is there, but in that specific region doesn't display it. I'm using a modification of the default skin (I changed to Linear, Linear instead on Nearest, Nearest), and I'm using freefonttype (linear, linear too). There is a picture on how it looks on linux, and how it looks on windows.
textEntry = new TextArea("enter text here.", AssetLoader.skin);
textEntry.setBounds(AssetLoader.LINE_START, 80, 540, 600);
stage.addActor(textEntry);
The following pictures show how it looks on linux and windows. The text is exactly the same.
Any suggestions??
Thanks in advance.
After some testing in other (real) machines, I found out that it is a virtual-box issue (I was trying it on virtualized windows machines).
More info: https://www.virtualbox.org/ticket/11889
Related
I feel noob on this one... But here it comes:
Let's take a Vector program with a PS exporter (with no font sub setting: important to change text dynamically in the future) more specifically the Inkscape version 0.46.
Document size A4 and lets draw some lines very close to the border and a simple text, after that you export your ps as noborder.ps:
Everything is really fine! What is on the first lines of postscript file?
%!PS-Adobe-3.0
%%Creator: 0.46
%%Pages: 1
%%Orientation: Portrait
%%BoundingBox: 0 0 596 842
%%HiResBoundingBox: 0 0 596 842
%%DocumentMedia: plain 596 842 0 () ()
%%EndComments
%%Page: 1 1
Now we need to generate a PS file from this PS file (Why? Some new fonts that cannot be uploaded to the printer and dynamically text are changed. PS2PS is a good choice to embed fonts and other elements prior to printing). Let's use ps2ps from ghostscript 8.7.
user#server:/$ ps2ps noborder.ps whyborder.ps
Very good! No errors on running... But... What? BORDERS? MARGINS? CROPPING?
Lets look at the whyborder.ps header:
%!PS-Adobe-3.0
%%Pages: (atend)
%%BoundingBox: 5 6 587 792
%%HiResBoundingBox: 5.000000 6.791406 586.732813 792.000000
%.........................................
%%Creator: GPL Ghostscript 870 (pswrite)
%%CreationDate: 2015/09/09 16:09:24
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%EndComments
%%BeginProlog
% This copyright applies to everything between here and the %%EndProlog:
Why is the BoundingBox changed??? Why add borders, margins, cropping?
I have tested options like "-dEPScrop", papersize... But the cropping remains... Why???
Firstly, stop using an ancient version of Ghostscript! 8.70 is now 6 years old, the current version is 9.16 (shortly to be superceded by 9.18).
Secondly, when experimenting like this do not use a script, use the command line directly. The device being used in the archaic version of GHostscript was pswrite, which was a very poor implementation and only supported level 1 output. The current code uses the ps2write device which is a much more powerful and flexible solution.
Note that in all cases running the input through Ghostscript does not 'embed fonts' or 'edit' or 'compress' the original. What happens is that your input is interpreted to produce graphics primitives which are fed to the device API, the device in question then processes the primitives. For a rendering device this means calling the graphics library to render the primitive to the canvas. For a high level device it means re-emitting the primitive , for example as a PDF operation.
ANY such processing brings inherent risks of approximation, the pswrite device was even worse in that much of the content was rendered to images. So in general it really doesn't embed new fonts, it just embeds pictures of the glyphs. This scales really badly and because the bounding box depends on the resolution can result in signficant inaccuracies.
You should really avoid doing ths unless there is no alternative. If you really must do it, be prepared to accept compromises, do not use archaic versions of Ghostscript and don't use the crappy old pswrite device.
Thank you KenS;
By upgrading the ghostscript to version 9.16 and using the following command everything was fine:
user#server:/$ ps2ps -sPAPERSIZE=a4 noborder.ps whyborder916.ps
This is a old and stable system (PHP/Bash/Ghostscript/CUPS), used for many years as a factory labeling system with old postscript printers also. More recently there was the need to change font style; ps2ps was the best choice to "embed" the glyphs and barcodes (postcript language) that dynamically change with the production line and packaging without need to change the printers (different models from different manufacturers). Since PostScript is a language with few changes in years, never crossed my mind to change the GS version.
At this point this is a real money saver! Thanks again!
No problems when running my app from Eclipse, but when exporting and running on desktop, all images from my TextureAtlas gets glitched, getting displayed as a black/gray boxes, as well as some weird stuff like white gradient boxes and lighting overlays.
Heres some screenshots of what I mean:
Wherever I'm suppose to have an image, thats some of the stuff I see instead.
I checked my .jar archive to see if the TextureAtlas resources made it through to the right directory that's not the issue.
app configs
cfg.useGL20 = true;
Anyone familiar with whats going on?
This problem was caused by a mismatch with the TexturePacker2 version used to create the altas, and the version used to load the atlas.
I'm beginner in flash. I created a text from the text_tool in flash. I set the instance name 'mytext' and text type to dynamic. Now I want to change the text on run time. For example: current text is 'hello world' now when I run the flash file I want to change the text to 'any random text'. So I used following code for this. mytext.text = 'any random text'; but on the run time I could see any text. Please help me how to change its text?
Thank you
There could be multiple reasons for that, Please check for the following:
If there are multiple frames on your timeline and your TextField is extended all over those frames then make sure you have provided the instance name to your TextField on all the KeyFrames on the timeline.
If you are using some fancy Fonts, try embedding the fonts, at times non-embedded Fonts create this problem.
for addition, you can use
your textfield.appendText();
good luck for your work :)
I developed a mobile app inside Adobe Flex (4.6) and it includes using pinch-to-zoom functionality to zoom in on pictures to make it easier to read words in the pictures. In previous android versions (2.1 to 2.3.3 and 2.3.4 if you're running cyanogenmod) the pinch-to-zoom works fine. But if the app is run on an ICS (Android 4.x) device, the axes seem to handle the enlargement of the picture individually. i.e. when you move your fingers apart horizontally, the image gets very wide, but stays the same vertical size, and vice versa.
First, does anyone know why this is happening?
And second, does anyone know of a way to fix it to work as it did before?
I will update to include screenshots.
Update: I have confirmed this is also an issue with Honeycomb. i.e., 3.x OS acts the same as 4.x ICS.
Sense, running the latest HTC update:
ICS, on AOKP, but verified this is an issue with standard ICS distros as well:
Solved this. Code was previously:
protected function onZoom(e:TransformGestureEvent, img:Image):void
{
DynamicRegistration.scale(img, new Point(e.localX, e.localY), img.scaleX*e.scaleX, img.scaleY*e.scaleY);
}
change the final e.scaleY to e.scaleX. This makes it scale based on only one portion of the zoom (in the x direction) and scales both X and Y accordingly. Not exactly perfect, but it works very well in practice.
Final code is this:
protected function onZoom(e:TransformGestureEvent, img:Image):void
{
DynamicRegistration.scale(img, new Point(e.localX, e.localY), img.scaleX*e.scaleX, img.scaleY*e.scaleX);
}
I'm creating an app with Alternativa3d (8.17.0), and would like to add labels to some cubes. But it doesn't seem like the Alternativa API provides a way to do it...
Now I know I can either:
Add a TextField to the Flash display list in the normal manner
Render the text as a bitmap beforehand and upload as a resource to the GPU
Render the text to a bitmap at run time, and upload as a resource to the GPU
BUT I need the content to be added directly to the Alternativa cube (which precludes the first option) and the text is dynamic (i.e. not known at compile time - precludes the second) and the third just feels hacky.
Is there a clean way to do this?
Depending on how you want the text displayed you could do a number of different things..
You could use a Sprite3D and add the text rendered as a bitmap. You can place the sprite3d near the cube and it will always face the camera so as you move around the cubes they will appear in 3d space but facing you at all times.
Another option is to add it to the actual cube as suggested by danii using a movieclip. However the link to that MovieClipMaterial is no longer valid and is actually for a previous version of Alternativa not version 8. I have created my own movieclipmaterial for version 8 here ( http://davidejones.com/blog/1392-moviematerial-alternativa3d-8/ ) should you want to do that.
Lastly you could render the text to bitmap and merge this with the cubes bitmap so the text is layered on top and then set this material onto the cube.
Personallt i'd use the sprite3d method its alot easier and i think will give a better effect. Take a look at this example which uses the same effect ( http://gkb40.ur.ru/web/map40a3d.swf )
Just put your TextField inside a MovieClip, and use the class MovieClipMaterial to set that MovieClip as a material for one of the sides of the cube.