2 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/devel-api/text-abstraction/emoji-helper.h>
23 namespace TextAbstraction
25 DALI_ADAPTOR_API bool IsSymbolScript(const TextAbstraction::Script& script)
27 return (TextAbstraction::SYMBOLS1 == script ||
28 TextAbstraction::SYMBOLS2 == script ||
29 TextAbstraction::SYMBOLS3 == script ||
30 TextAbstraction::SYMBOLS4 == script ||
31 TextAbstraction::SYMBOLS5 == script ||
32 TextAbstraction::SYMBOLS_NSLCL == script);
35 DALI_ADAPTOR_API bool IsEmojiScript(const TextAbstraction::Script& script)
37 return (TextAbstraction::EMOJI == script);
40 DALI_ADAPTOR_API bool IsEmojiTextScript(const TextAbstraction::Script& script)
42 return (TextAbstraction::EMOJI_TEXT == script);
45 DALI_ADAPTOR_API bool IsEmojiColorScript(const TextAbstraction::Script& script)
47 return (TextAbstraction::EMOJI_COLOR == script);
50 DALI_ADAPTOR_API bool IsOneOfEmojiScripts(const TextAbstraction::Script& script)
52 return (IsEmojiScript(script) || IsEmojiColorScript(script) || IsEmojiTextScript(script));
55 DALI_ADAPTOR_API bool IsSymbolOrEmojiScript(const TextAbstraction::Script& script)
57 return (IsEmojiScript(script) || IsSymbolScript(script));
60 DALI_ADAPTOR_API bool IsSymbolOrEmojiOrTextScript(const TextAbstraction::Script& script)
62 return (IsSymbolScript(script) || IsOneOfEmojiScripts(script));
65 DALI_ADAPTOR_API Character GetUnicodeForInvisibleGlyph()
67 return TextAbstraction::CHAR_ZWS;
70 } // namespace TextAbstraction