Giter Site home page Giter Site logo

stbsharp's People

Contributors

rds1983 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stbsharp's Issues

StpSharp.MonoGame.WindowsDX.Test - no UTF8 support for text?

Hello
Trying to test stb_truetype for unicode text output:

        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            // TODO: Add your drawing code here
            _spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);

            _spriteBatch.Draw(_image, new Vector2(0, 0));
            _spriteBatch.Draw(_fontTexture, new Vector2(_image.Width + 10, 0));

            DrawTTFString(_spriteBatch, "E: The quick brown fox jumps over the lazy dog, I: An ḃfuil do ċroí ag bualaḋ ó ḟaitíos",
                new Vector2(0, _image.Height + 30), Color.White);
            DrawTTFString(_spriteBatch, "G: Üben quält finſteren Jagdſchloß höf‌liche Bäcker größeren, N: Blåbærsyltetøy",
                new Vector2(0, _image.Height + 60), Color.White);
            DrawTTFString(_spriteBatch, "D: Høj bly gom vandt fræk sexquiz på wc, S: bäckasiner söka",
                new Vector2(0, _image.Height + 90), Color.White);
            DrawTTFString(_spriteBatch, "I: Sævör grét áðan því úlpan var ónýt, P: Pchnąć w tę łódź jeża lub osiem skrzyń fig",
                new Vector2(0, _image.Height + 120), Color.White);
            DrawTTFString(_spriteBatch, "C: Příliš žluťoučký kůň úpěl ďábelské kódy, R: В чащах юга жил-был цитрус? Да, но фальшивый экземпляр! ёъ.",
                new Vector2(0, _image.Height + 160), Color.White);
            DrawTTFString(_spriteBatch, "S: kilómetros y frío, añoraba, P: vôo à noite, F: Les naïfs ægithales hâtifs pondant à Noël où",
                new Vector2(0, _image.Height + 190), Color.White);
            DrawTTFString(_spriteBatch, "J: いろはにほへど",
                new Vector2(0, _image.Height + 220), Color.White);

            _spriteBatch.End();

            base.Draw(gameTime);
        }

But see this:
https://i.imgur.com/Kc3cmNu.png
Tried different fonts, no result.
Can you please tell me what I do wrong, or is it a restriction of StbSharp?

Incorrect Generated Code

Was looking through the StbImageWrite.Generated.cs files, and noticed this...

if (256 <= 143)
{
	// Removed for brevity
}
else if (256 <= 255)
{
	// Removed for brevity
}
else if (256 <= 279)
{
	// Removed for brevity
}

I am going to assume this portion did not generate correctly, as 256 is never going to be less than 143 or 255, and always be less than 279.

Opentk compat

Hey,
Im currently working with OpenTK and trying to use StbSharp to load a texture(in dot net core 2) i have tried using

        private byte[] LoadTexture(string filename, out int width, out int height)
        {
            ImageReader loader = new ImageReader();
            using (Stream stream = File.Open(filename, FileMode.Open)) 
            {
                byte[] buffer = File.ReadAllBytes(filename);
                Image image = Stb.LoadFromMemory(buffer, Stb.STBI_rgb_alpha);

                width = image.Width;
                height = image.Height;
                return image.Data;
            }
        }

and using the returning bytes directly with opentk which doesnt seem
Does anyone have any advice?

在unity中

  你好,我目前正在使用Unity3d,并试图使用StbSharp加载一个纹理,加载后的纹理是FilpY的效果

        UnityEngine.Texture2D texture2D = new UnityEngine.Texture2D(Image.Width, Image.Height);
        texture2D.SetPixels32(ToColors(Image.Data));
        texture2D.Apply();
        有什么解决方法吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.