Beispiel #1
0
def main():
    standardized_variants.Load()
    emoji_vs_code_points = standardized_variants.GetSetOfUnicodeWithEmojiVS()
    print
    print("Unicode Standard code points with emoji-style " +
          "Variation Selector sequences:")
    print
    print "C++: " + SetToUnicodeSetPattern(emoji_vs_code_points, _EscapeForCpp)
    print
    print "Java: " + SetToUnicodeSetPattern(emoji_vs_code_points,
                                            _EscapeForJava)

    emoji4unicode.Load()
    pua_vs_code_points = set()
    for symbol in emoji4unicode.GetSymbols():
        if symbol.UnicodeHasVariationSequence():
            # Get the Google Private Use Area code point.
            pua = symbol.GetCarrierUnicode("google")
            if not pua.startswith("<"):
                # Round-trip, must be a single code point.
                pua_vs_code_points.add(int(pua, 16))
    print
    print("Google PUA code points corresponding to Unicode Standard " +
          "code points with emoji-style Variation Selector sequences:")
    print
    print "C++: " + SetToUnicodeSetPattern(pua_vs_code_points, _EscapeForCpp)
    print
    print "Java: " + SetToUnicodeSetPattern(pua_vs_code_points, _EscapeForJava)

    if len(emoji_vs_code_points) != len(pua_vs_code_points):
        raise ValueError("Mismatch: %d standard code points with VS16 but " +
                         "%d corresponding Google PUA code points" %
                         (len(emoji_vs_code_points), len(pua_vs_code_points)))
def main():
    emoji4unicode.Load()
    here = os.path.dirname(__file__)
    path = os.path.join(here, "..", "generated")
    _WritePartialMappingFile(path, "docomo", True)
    _WritePartialMappingFile(path, "docomo", False)
    _WritePartialMappingFile(path, "kddi", True)
    _WritePartialMappingFile(path, "kddi", False)
    _WritePartialMappingFile(path, "softbank", True)
    # We do not have JIS mapping data for SoftBank.

    if len(sys.argv) >= 2:
        # Use a custom Shift-JIS table as the base.
        sjis_filename = sys.argv[1]
    else:
        # Use the Windows Shift-JIS table as the base.
        sjis_filename = os.path.join(here, "..", "data", "icu",
                                     "windows-932-2000.ucm")
    with codecs.open(sjis_filename, "r") as sjis_reader:
        _WriteCompleteMappingFile(sjis_reader, path, "docomo", True)
        _WriteCompleteMappingFile(sjis_reader, path, "docomo", False)
        _WriteCompleteMappingFile(sjis_reader, path, "kddi", True)
        _WriteCompleteMappingFile(sjis_reader, path, "kddi", False)
        _WriteCompleteMappingFile(sjis_reader, path, "softbank", True)
        # We do not have JIS mapping data for SoftBank.
    filename = os.path.join(path, "transform_gpua.txt")
    with codecs.open(filename, "w", "UTF-8") as writer:
        _WriteGooglePUATransformFile(writer)
def main():
    emoji4unicode.Load()
    here = os.path.dirname(__file__)
    filename = os.path.join(here, "..", "generated", "font_db.txt")
    _WriteFontDB(codecs.open(filename, "w", "UTF-8"))
    filename = os.path.join(here, "..", "generated", "emoji_post_source.xml")
    _WritePostXML(codecs.open(filename, "w", "UTF-8"))
    filename = os.path.join(here, "..", "generated", "emoji_cmap_source.xml")
    _WriteCmapXML(codecs.open(filename, "w", "UTF-8"))
Beispiel #4
0
def main():
    global _only_in_proposal, _no_unified, _no_fallbacks
    global _no_codes, _no_symbol_numbers
    for i in range(1, len(sys.argv)):
        if sys.argv[i] == "--only_in_proposal": _only_in_proposal = True
        if sys.argv[i] == "--no_codes": _no_codes = True
        if sys.argv[i] == "--design":
            _only_in_proposal = True
            _no_unified = True
            _no_fallbacks = True
            _no_codes = True
            _no_symbol_numbers = True
    emoji4unicode.Load()
    _WriteEmoji4UnicodeHTML(codecs.getwriter("UTF-8")(sys.stdout))
def main():
  emoji4unicode.Load()
  docomo_data = emoji4unicode.all_carrier_data["docomo"]
  img_from_counts = {"docomo":0, "kddi":0, "softbank":0, "google":0}
  docomo_exp = 0
  only_docomo_exp = 0
  for symbol in emoji4unicode.GetSymbols():
    if not symbol.in_proposal: continue
    if symbol.GetUnicode(): continue
    img_from = symbol.ImageFromWhichCarrier()
    img_from_counts[img_from] += 1
    if img_from == "docomo":
      docomo_uni = symbol.GetCarrierUnicode("docomo")
      docomo_symbol = docomo_data.SymbolFromUnicode(docomo_uni)
      if docomo_symbol.number >= 300:  # Expansion Pictogram
        docomo_exp += 1
        has_kddi = False
        kddi_uni = symbol.GetCarrierUnicode("kddi")
        if kddi_uni and not kddi_uni.startswith(">"):
          has_kddi = True
        has_softbank = False
        softbank_uni = symbol.GetCarrierUnicode("softbank")
        if softbank_uni and not softbank_uni.startswith(">"):
          has_softbank = True
        msg = "e-%s img_from=docomo" % symbol.id
        if not has_kddi and not has_softbank:
          msg += " Expansion Pictogram only"
          only_docomo_exp += 1
        else:
          if has_kddi: msg += ", kddi available"
          if has_softbank: msg += ", softbank available"
        print msg
  print "Number of symbol images from which carrier:"
  print img_from_counts
  print ("Number of symbol images from DoCoMo Expansion Pictograms: %d" %
         docomo_exp)
  print ("Number of these symbol images where there are no KDDI or SoftBank "
         "round-trip mappings: %d" %
         only_docomo_exp)
Beispiel #6
0
def main():
    global _only_in_proposal, _no_unified, _no_temp_notes, _no_fallbacks
    global _no_codes, _no_symbol_numbers, _show_font_chars, _show_only_font_chars
    global _show_real_chars
    _proposed_by_unicode = False
    _emoji_data = False
    for i in range(1, len(sys.argv)):
        if sys.argv[i] == "--only_in_proposal": _only_in_proposal = True
        if sys.argv[i] == "--no_codes": _no_codes = True
        if sys.argv[i] == "--proposed_by_unicode":
            _no_temp_notes = True
            _proposed_by_unicode = True
        if sys.argv[i] == "--emoji_data":
            _show_real_chars = True
            _no_temp_notes = True
            _emoji_data = True
        if sys.argv[i] == "--show_font_chars":
            _show_font_chars = True
        if sys.argv[i] == "--show_only_font_chars":
            _show_font_chars = True
            _show_only_font_chars = True
        if sys.argv[i] == "--design":
            _only_in_proposal = True
            _no_unified = True
            _no_fallbacks = True
            _no_codes = True
            _no_symbol_numbers = True
            _show_font_chars = True
    emoji4unicode.Load()
    unicode_age.Load()
    writer = codecs.getwriter("UTF-8")(sys.stdout)
    if _emoji_data:
        _WriteEmojiDataHTML(writer)
    elif _proposed_by_unicode:
        _WriteProposedEmojiHTML(writer)
    else:
        _WriteEmoji4UnicodeHTML(writer)
Beispiel #7
0
 def setUp(self):
     emoji4unicode.Load()
     unicode_names.Load()
def main():
  emoji4unicode.Load()
  here = os.path.dirname(__file__)
  filename = os.path.join(here, "..", "generated", "EmojiSources.txt")
  _WriteSourcesFile(codecs.open(filename, "w", "UTF-8"))
Beispiel #9
0
 def setUp(self):
   emoji4unicode.Load()
   here = os.path.dirname(__file__)
   filename = os.path.join(here, "..", "data", "icu", "windows-932-2000.ucm")
   self.__shift_jis_ucm = ucm.UCMFile(filename)
def main():
    emoji4unicode.Load()
    here = os.path.dirname(__file__)
    filename = os.path.join(here, "..", "generated", "NamesList.txt")
    _WriteNamesList(codecs.open(filename, "w", "ISO-8859-1"))
Beispiel #11
0
def main():
    emoji4unicode.Load()
    here = os.path.dirname(__file__)
    filename = os.path.join(here, "..", "generated", "emoji_cfl.txt")
    _WriteChartFontListFile(codecs.open(filename, "w", "UTF-8"))