<commit_before>// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <TargetConditionals.h>
#include "txt/platform.h"

#if TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR
#include <UIKit/UIKit.h>
#define FONT_CLASS UIFont
#else  // TARGET_OS_EMBEDDED
#include <AppKit/AppKit.h>
#define FONT_CLASS NSFont
#endif  // TARGET_OS_EMBEDDED

namespace txt {

std::string GetDefaultFontFamily() {
  return [FONT_CLASS systemFontOfSize:14].familyName.UTF8String;
}

}  // namespace txt<commit_msg>libtxt: use Helvetica as a fallback font on iOS 8 and earlier (#4930)<commit_after>// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <TargetConditionals.h>
#include "flutter/fml/platform/darwin/platform_version.h"
#include "txt/platform.h"

#if TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR
#include <UIKit/UIKit.h>
#define FONT_CLASS UIFont
#else  // TARGET_OS_EMBEDDED
#include <AppKit/AppKit.h>
#define FONT_CLASS NSFont
#endif  // TARGET_OS_EMBEDDED

namespace txt {

std::string GetDefaultFontFamily() {
  if (fml::IsPlatformVersionAtLeast(9)) {
    return [FONT_CLASS systemFontOfSize:14].familyName.UTF8String;
  } else {
    return "Helvetica";
  }
}

}  // namespace txt
{'fraction_non_alphanumeric': 0.10192444761225944, 'fraction_numerical': 0.014255167498218105, 'mean_word_length': 4.7306122448979595, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '659138', 'n_tokens_mistral': 505, 'n_tokens_neox': 491, 'n_words': 134}