StrokerLineJoin.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #region MIT License
  2. /*Copyright (c) 2012 Robert Rouhani <robert.rouhani@gmail.com>
  3. SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team
  4. Permission is hereby granted, free of charge, to any person obtaining a copy of
  5. this software and associated documentation files (the "Software"), to deal in
  6. the Software without restriction, including without limitation the rights to
  7. use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
  8. of the Software, and to permit persons to whom the Software is furnished to do
  9. so, subject to the following conditions:
  10. The above copyright notice and this permission notice shall be included in all
  11. copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  18. SOFTWARE.*/
  19. #endregion
  20. using System;
  21. namespace SharpFont
  22. {
  23. /// <summary>
  24. /// These values determine how two joining lines are rendered in a stroker.
  25. /// </summary>
  26. public enum StrokerLineJoin
  27. {
  28. /// <summary>
  29. /// Used to render rounded line joins. Circular arcs are used to join two lines smoothly.
  30. /// </summary>
  31. Round = 0,
  32. /// <summary>
  33. /// Used to render beveled line joins. The outer corner of the joined lines is filled by enclosing the
  34. /// triangular region of the corner with a straight line between the outer corners of each stroke.
  35. /// </summary>
  36. Bevel = 1,
  37. /// <summary>
  38. /// Used to render mitered line joins, with fixed bevels if the miter limit is exceeded. The outer edges of the
  39. /// strokes for the two segments are extended until they meet at an angle. If the segments meet at too sharp an
  40. /// angle (such that the miter would extend from the intersection of the segments a distance greater than the
  41. /// product of the miter limit value and the border radius), then a bevel join (see above) is used instead.
  42. /// This prevents long spikes being created. <see cref="MiterFixed"/> generates a miter line join as used in
  43. /// PostScript and PDF.
  44. /// </summary>
  45. MiterVariable = 2,
  46. /// <summary>
  47. /// An alias for <see cref="MiterVariable"/>, retained for backwards compatibility.
  48. /// </summary>
  49. Miter = MiterVariable,
  50. /// <summary>
  51. /// Used to render mitered line joins, with variable bevels if the miter limit is exceeded. The intersection of
  52. /// the strokes is clipped at a line perpendicular to the bisector of the angle between the strokes, at the
  53. /// distance from the intersection of the segments equal to the product of the miter limit value and the border
  54. /// radius. This prevents long spikes being created. <see cref="MiterVariable"/> generates a mitered line join
  55. /// as used in XPS.
  56. /// </summary>
  57. MiterFixed = 3
  58. }
  59. }