# Path: Lib/glyphsLib/builder/glyph.py
# SCRIPT_LIB_KEY = GLYPHLIB_PREFIX + "script"
# ORIGINAL_WIDTH_KEY = GLYPHLIB_PREFIX + "originalWidth"
# BACKGROUND_WIDTH_KEY = GLYPHLIB_PREFIX + "backgroundWidth"
# def _clone_layer(layer, paths=None, components=None):
# def to_ufo_glyph(self, ufo_glyph, layer, glyph, do_color_layers=True):  # noqa: C901
# def to_glyphs_glyph(self, ufo_glyph, ufo_layer, master):  # noqa: C901
# def to_ufo_glyph_height_and_vertical_origin(self, ufo_glyph, layer):
# def _get_typo_ascender_descender(master):
# def to_ufo_glyph_background(self, glyph, layer):
# def _to_glyphs_color(color):
# def to_glyphs_glyph_height_and_vertical_origin(self, ufo_glyph, master, layer):


import re
from .glyph import BRACKET_GLYPH_RE
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.




UFO_KERN_GROUP_PATTERN = re.compile("^public\\.kern([12])\\.(.*)$")


def to_ufo_kerning(self):
    for master in self.font.masters:
        master_id = master.id
        kerning_source = master.metricsSource.id  # Maybe be a linked master
        if kerning_source in self.font.kerning:

# Path: Lib/glyphsLib/builder/glyph.py
# SCRIPT_LIB_KEY = GLYPHLIB_PREFIX + "script"
# ORIGINAL_WIDTH_KEY = GLYPHLIB_PREFIX + "originalWidth"
# BACKGROUND_WIDTH_KEY = GLYPHLIB_PREFIX + "backgroundWidth"
# def _clone_layer(layer, paths=None, components=None):
# def to_ufo_glyph(self, ufo_glyph, layer, glyph, do_color_layers=True):  # noqa: C901
# def to_glyphs_glyph(self, ufo_glyph, ufo_layer, master):  # noqa: C901
# def to_ufo_glyph_height_and_vertical_origin(self, ufo_glyph, layer):
# def _get_typo_ascender_descender(master):
# def to_ufo_glyph_background(self, glyph, layer):
# def _to_glyphs_color(color):
# def to_glyphs_glyph_height_and_vertical_origin(self, ufo_glyph, master, layer):


# Path: Lib/glyphsLib/builder/kerning.py
import re
from .glyph import BRACKET_GLYPH_RE

# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.




UFO_KERN_GROUP_PATTERN = re.compile("^public\\.kern([12])\\.(.*)$")


def to_ufo_kerning(self):
    for master in self.font.masters:
        master_id = master.id
        kerning_source = master.metricsSource.id  # Maybe be a linked master
        if kerning_source in self.font.kerning:

            kerning = self.font.kerning[kerning_source]