Skip to content

Commit

Permalink
Merge pull request #7 from Earthmark/neos_jp_character_fix
Browse files Browse the repository at this point in the history
Neos jp character fix
  • Loading branch information
Earthmark committed Nov 14, 2021
2 parents 9898970 + 790b214 commit b5c3496
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions dll_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@

using namespace msdfgen;

template <int N>
static void invertColor(const BitmapRef<float, N> &bitmap) {
const float *end = bitmap.pixels + N * bitmap.width*bitmap.height;
for (float *p = bitmap.pixels; p < end; ++p)
*p = 1.f - *p;
}

DLL_EXPORT Shape* DLL_API create_shape()
{
Shape* shape = new Shape();
Expand Down Expand Up @@ -80,17 +73,6 @@ DLL_EXPORT void DLL_API shape_generateMSDF(float* pixels, int width, int height,
// and there's no documentation as to what the intent was.

generateMSDF(msdf, *shape, projection, range, generatorConfig);

// Get sign of signed distance outside bounds
// This was taken from main.cpp as a way to guess the expected orientation.
Shape::Bounds bounds = shape->getBounds();
Point2 p(bounds.l - (bounds.r - bounds.l) - 1, bounds.b - (bounds.t - bounds.b) - 1);
double distance = SimpleTrueShapeDistanceFinder::oneShotDistance(*shape, p);
if (distance >= 0) {
invertColor(msdf);
}

// This call is where the errors are introduced, but it corrects the inversion.
distanceSignCorrection(msdf, *shape, projection, FILL_NONZERO);
msdfErrorCorrection(msdf, *shape, projection, range, postErrorCorrectionConfig);
}

0 comments on commit b5c3496

Please sign in to comment.