You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GlyphDefinitionSubtable.java 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.complexscripts.fonts;
  19. // CSOFF: LineLengthCheck
  20. /**
  21. * <p>The <code>GlyphDefinitionSubtable</code> implements an abstract base of a glyph definition subtable,
  22. * providing a default implementation of the <code>GlyphDefinition</code> interface.</p>
  23. *
  24. * <p>This work was originally authored by Glenn Adams (gadams@apache.org).</p>
  25. */
  26. public abstract class GlyphDefinitionSubtable extends GlyphSubtable implements GlyphDefinition {
  27. /**
  28. * Instantiate a <code>GlyphDefinitionSubtable</code>.
  29. * @param id subtable identifier
  30. * @param sequence subtable sequence
  31. * @param flags subtable flags
  32. * @param format subtable format
  33. * @param mapping subtable coverage table
  34. */
  35. protected GlyphDefinitionSubtable(String id, int sequence, int flags, int format, GlyphMappingTable mapping) {
  36. super(id, sequence, flags, format, mapping);
  37. }
  38. /** {@inheritDoc} */
  39. public int getTableType() {
  40. return GlyphTable.GLYPH_TABLE_TYPE_DEFINITION;
  41. }
  42. /** {@inheritDoc} */
  43. public String getTypeName() {
  44. return GlyphDefinitionTable.getLookupTypeName(getType());
  45. }
  46. /** {@inheritDoc} */
  47. public boolean usesReverseScan() {
  48. return false;
  49. }
  50. /** {@inheritDoc} */
  51. public boolean hasDefinition(int gi) {
  52. GlyphCoverageMapping cvm;
  53. if ((cvm = getCoverage()) != null) {
  54. if (cvm.getCoverageIndex(gi) >= 0) {
  55. return true;
  56. }
  57. }
  58. GlyphClassMapping clm;
  59. if ((clm = getClasses()) != null) {
  60. if (clm.getClassIndex(gi, 0) >= 0) {
  61. return true;
  62. }
  63. }
  64. return false;
  65. }
  66. }