private void InterletterSpaceJP(UChar letterBefore, float zwSizeBefore, UChar letterAfter, float zwSizeAfter, out float zwSpaceSize, out float baseSize) { var beforeSpaceType = letterBefore.GetSpaceType(); var afterSpaceType = letterAfter.GetSpaceType(); switch (beforeSpaceType) { case SpaceType.Closing: switch (afterSpaceType) { case SpaceType.Closing: case SpaceType.DividingPunctuation: case SpaceType.MiddleDots: zwSpaceSize = 0F; baseSize = zwSizeBefore; break; case SpaceType.Opening: case SpaceType.Normal: default: zwSpaceSize = 0.5F; baseSize = zwSizeBefore; break; } break; case SpaceType.DividingPunctuation: switch (afterSpaceType) { case SpaceType.Closing: case SpaceType.DividingPunctuation: zwSpaceSize = 0F; baseSize = zwSizeBefore; break; case SpaceType.MiddleDots: zwSpaceSize = 0.25F; baseSize = zwSizeAfter; break; case SpaceType.Opening: zwSpaceSize = 0.5F; baseSize = zwSizeAfter; break; case SpaceType.Normal: default: zwSpaceSize = 1.0F; baseSize = zwSizeBefore; break; } break; case SpaceType.MiddleDots: switch (afterSpaceType) { case SpaceType.Opening: zwSpaceSize = 0.5F; baseSize = zwSizeAfter; break; case SpaceType.Closing: case SpaceType.DividingPunctuation: case SpaceType.MiddleDots: zwSpaceSize = 0F; baseSize = zwSizeBefore; break; case SpaceType.Normal: default: zwSpaceSize = 0.25F; baseSize = zwSizeBefore; break; } break; case SpaceType.Opening: switch (afterSpaceType) { case SpaceType.Opening: case SpaceType.Closing: case SpaceType.DividingPunctuation: case SpaceType.MiddleDots: case SpaceType.Normal: default: zwSpaceSize = 0F; baseSize = zwSizeBefore; break; } break; case SpaceType.Normal: default: switch (afterSpaceType) { case SpaceType.Opening: zwSpaceSize = 0.5F; baseSize = zwSizeAfter; break; case SpaceType.MiddleDots: zwSpaceSize = 0.25F; baseSize = zwSizeAfter; break; case SpaceType.Closing: case SpaceType.DividingPunctuation: case SpaceType.Normal: default: zwSpaceSize = 0F; baseSize = zwSizeBefore; break; } break; } }
private void InterletterSpaceJP(UChar letterBefore, float zwSizeBefore, UChar letterAfter, float zwSizeAfter, out float zwSpaceSize, out float baseSize) { var beforeSpaceType = letterBefore.GetSpaceType(); var afterSpaceType = letterAfter.GetSpaceType(); switch (beforeSpaceType) { case SpaceType.Closing: switch (afterSpaceType) { case SpaceType.Closing: case SpaceType.DividingPunctuation: case SpaceType.MiddleDots: zwSpaceSize = 0F; baseSize = zwSizeBefore; break; case SpaceType.Opening: case SpaceType.Normal: default: zwSpaceSize = 0.5F; baseSize = zwSizeBefore; break; } break; case SpaceType.DividingPunctuation: switch (afterSpaceType) { case SpaceType.Closing: case SpaceType.DividingPunctuation: zwSpaceSize = 0F; baseSize = zwSizeBefore; break; case SpaceType.MiddleDots: zwSpaceSize = 0.25F; baseSize = zwSizeAfter; break; case SpaceType.Opening: zwSpaceSize = 0.5F; baseSize = zwSizeAfter; break; case SpaceType.Normal: default: zwSpaceSize = 1.0F; baseSize = zwSizeBefore; break; } break; case SpaceType.MiddleDots: switch (afterSpaceType) { case SpaceType.Opening: zwSpaceSize = 0.5F; baseSize = zwSizeAfter; break; case SpaceType.Closing: case SpaceType.DividingPunctuation: case SpaceType.MiddleDots: zwSpaceSize = 0F; baseSize = zwSizeBefore; break; case SpaceType.Normal: default: zwSpaceSize = 0.25F; baseSize = zwSizeBefore; break; } break; case SpaceType.Opening: switch (afterSpaceType) { case SpaceType.Opening: case SpaceType.Closing: case SpaceType.DividingPunctuation: case SpaceType.MiddleDots: case SpaceType.Normal: default: zwSpaceSize = 0F; baseSize = zwSizeBefore; break; } break; case SpaceType.Normal: default: switch (afterSpaceType) { case SpaceType.Opening: zwSpaceSize = 0.5F; baseSize = zwSizeAfter; break; case SpaceType.MiddleDots: zwSpaceSize = 0.25F; baseSize = zwSizeAfter; break; case SpaceType.Closing: case SpaceType.DividingPunctuation: case SpaceType.Normal: default: zwSpaceSize = 0F; baseSize = zwSizeBefore; break; } break; } }